diff options
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 { |