summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7a5ca63)
After formatting a number with the help of sprintf, it is localized, i.e.
the decimal point might not be a decimal point anymore. So don't try to
compare it numerically (i.e. with '<' or '>') since that will not work.
$page_content->{archive} = $archive;
$page_content->{suite} = $suite;
$page_content->{pkg} = $pkg;
$page_content->{archive} = $archive;
$page_content->{suite} = $suite;
$page_content->{pkg} = $pkg;
- $page_content->{pkgsize} = sprintf( '%.1f', floor(($data{size}/102.4)+0.5)/10 );
- $page_content->{pkgsize_unit} = _g( 'kByte' );
- if ($page_content->{pkgsize} > 1024) {
+ my $pkgsize = floor(($data{size}/102.4)+0.5)/10;
+ if ($pkgsize < 1024) {
+ $page_content->{pkgsize} = sprintf( '%.1f', $pkgsize );
+ $page_content->{pkgsize_unit} = _g( 'kByte' );
+ } else {
$page_content->{pkgsize} = sprintf( '%.1f', floor(($data{size}/(102.4*102.4))+0.5)/100 );
$page_content->{pkgsize_unit} = _g( 'MByte' );
}
$page_content->{pkgsize} = sprintf( '%.1f', floor(($data{size}/(102.4*102.4))+0.5)/100 );
$page_content->{pkgsize_unit} = _g( 'MByte' );
}