diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-06-11 13:07:30 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-06-11 13:07:30 +0000 |
commit | 17f7498cb36b2b155f4e005b2ab1be1aa089cd54 (patch) | |
tree | a6002043de1473c99607ddb2c9f823b544ec642e /perl-install/common.pm | |
parent | 7eba8f8646a98f8a4c90d3bbf87b870a0ae4580f (diff) | |
download | drakx-17f7498cb36b2b155f4e005b2ab1be1aa089cd54.tar drakx-17f7498cb36b2b155f4e005b2ab1be1aa089cd54.tar.gz drakx-17f7498cb36b2b155f4e005b2ab1be1aa089cd54.tar.bz2 drakx-17f7498cb36b2b155f4e005b2ab1be1aa089cd54.tar.xz drakx-17f7498cb36b2b155f4e005b2ab1be1aa089cd54.zip |
- diskdrake
o fix 1.9TB displayed as 1TB
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r-- | perl-install/common.pm | 12 |
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 { |