summaryrefslogtreecommitdiffstats
path: root/perl-install/common.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-06-11 13:07:30 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-06-11 13:07:30 +0000
commit17f7498cb36b2b155f4e005b2ab1be1aa089cd54 (patch)
treea6002043de1473c99607ddb2c9f823b544ec642e /perl-install/common.pm
parent7eba8f8646a98f8a4c90d3bbf87b870a0ae4580f (diff)
downloaddrakx-backup-do-not-use-17f7498cb36b2b155f4e005b2ab1be1aa089cd54.tar
drakx-backup-do-not-use-17f7498cb36b2b155f4e005b2ab1be1aa089cd54.tar.gz
drakx-backup-do-not-use-17f7498cb36b2b155f4e005b2ab1be1aa089cd54.tar.bz2
drakx-backup-do-not-use-17f7498cb36b2b155f4e005b2ab1be1aa089cd54.tar.xz
drakx-backup-do-not-use-17f7498cb36b2b155f4e005b2ab1be1aa089cd54.zip
- diskdrake
o fix 1.9TB displayed as 1TB
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r--perl-install/common.pm12
1 files changed, 7 insertions, 5 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index d297225af..0f2154244 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -128,15 +128,17 @@ sub formatXiB {
($nb, $base) = ($newnb, $newbase);
$base >= 1024 ? ($newbase = $base / 1024) : ($newnb = $nb / 1024);
};
- foreach (N("B"), N("KB"), N("MB"), N("GB")) {
+ my $suffix;
+ foreach (N("B"), N("KB"), N("MB"), N("GB"), N("TB")) {
$decr->();
if ($newnb < 1 && $newnb * $newbase < 1) {
- my $v = $nb * $base;
- my $s = $v < 10 && int(10 * $v - 10 * int($v));
- return int($v) . ($s ? ".$s" : '') . $_;
+ $suffix = $_;
+ last;
}
}
- int($newnb * $newbase) . N("TB");
+ my $v = $nb * $base;
+ my $s = $v < 10 && int(10 * $v - 10 * int($v));
+ int($v) . ($s ? ".$s" : '') . ($suffix || N("TB"));
}
sub formatTime {