- return(sprintf("%.2f Kbytes", $bc/1000))
- if ($bc < 1000000);
- return(sprintf("%.2f Mbytes", $bc/1000000))
- if ($bc < 1000000000);
- return(sprintf("%.2f Gbytes", $bc/1000000000));
+ return(sprintf("%.2f Kbytes", $bc/1024))
+ if ($bc < 1048576);
+ return(sprintf("%.2f Mbytes", $bc/1048576))
+ if ($bc < 1073741824);
+ return(sprintf("%.2f Gbytes", $bc/1073741824));
}
=item parse_bytecount AMOUNT
Accepts a number (digits and a decimal point) possibly followed by k, m, g, or
t (and an optional 'b') in either case. Returns a pure number representing
}
=item parse_bytecount AMOUNT
Accepts a number (digits and a decimal point) possibly followed by k, m, g, or
t (and an optional 'b') in either case. Returns a pure number representing
return $bc unless length $base;
my $exponent = index ' kmgt', lc($2);
return $bc if ($exponent < 0 && $2);
$exponent = 0 if ($exponent < 0);
return $bc unless length $base;
my $exponent = index ' kmgt', lc($2);
return $bc if ($exponent < 0 && $2);
$exponent = 0 if ($exponent < 0);
? $conf->config('datavolume-significantdigits')
: 3;
my $unit = $conf->exists('datavolume-forcemegabytes') ? 'M' : 'A';
? $conf->config('datavolume-significantdigits')
: 3;
my $unit = $conf->exists('datavolume-forcemegabytes') ? 'M' : 'A';