wrong decimal duration for more than 1000 hours (#2214)

This commit is contained in:
Kevin Papst
2020-12-21 13:08:43 +01:00
committed by GitHub
parent 6ada0b649c
commit 74b3917e69
2 changed files with 12 additions and 1 deletions

View File

@@ -46,7 +46,12 @@ final class LocaleHelper
*/
public function durationDecimal(int $seconds)
{
return $this->getNumberFormatter()->format(number_format($seconds / 3600, 2));
$value = round($seconds / 3600, 2);
if ($value <= 0) {
$value = 0;
}
return $this->getNumberFormatter()->format($value);
}
/**