lib: Fix sprintf format strings used in Format::seconds()

fixes #9291

Signed-off-by: Eric Lippmann <eric.lippmann@netways.de>
This commit is contained in:
rbelinsky 2015-05-19 19:11:53 +03:00 committed by Eric Lippmann
parent 20a9621036
commit b0f7773260
1 changed files with 3 additions and 3 deletions

View File

@ -59,13 +59,13 @@ class Format
if ($value < 60) {
return self::formatForUnits($value, self::$secondPrefix, self::$secondBase);
} elseif ($value < 3600) {
return sprintf('0.2f m', $value / 60);
return sprintf('%0.2f m', $value / 60);
} elseif ($value < 86400) {
return sprintf('0.2f h', $value / 3600);
return sprintf('%0.2f h', $value / 3600);
}
// TODO: Do we need weeks, months and years?
return sprintf('0.2f d', $value / 86400);
return sprintf('%0.2f d', $value / 86400);
}
protected static function formatForUnits($value, & $units, $base)