mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 08:14:03 +02:00
parent
08c879249b
commit
c04b2594a6
@ -54,11 +54,13 @@ class Format
|
|||||||
|
|
||||||
public static function seconds($value)
|
public static function seconds($value)
|
||||||
{
|
{
|
||||||
if ($value < 60) {
|
$absValue = abs($value);
|
||||||
|
|
||||||
|
if ($absValue < 60) {
|
||||||
return self::formatForUnits($value, self::$secondPrefix, self::$secondBase);
|
return self::formatForUnits($value, self::$secondPrefix, self::$secondBase);
|
||||||
} elseif ($value < 3600) {
|
} elseif ($absValue < 3600) {
|
||||||
return sprintf('%0.2f m', $value / 60);
|
return sprintf('%0.2f m', $value / 60);
|
||||||
} elseif ($value < 86400) {
|
} elseif ($absValue < 86400) {
|
||||||
return sprintf('%0.2f h', $value / 3600);
|
return sprintf('%0.2f h', $value / 3600);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user