only show one sig fig

master
Joey Hess 2008-07-01 18:41:30 -04:00
parent e8a13c32ba
commit 0abaf5aaae
1 changed files with 1 additions and 1 deletions

View File

@ -227,7 +227,7 @@ sub humansize ($) { #{{{
foreach my $unit (reverse sort { $units{$a} <=> $units{$b} || $b cmp $a } keys %units) {
if ($size / $units{$unit} > 0.25) {
return (int($size / $units{$unit} * 100)/100)."$unit";
return (int($size / $units{$unit} * 10)/10)."$unit";
}
}
return $size; # near zero, or negative