PerfDataFormat: Ensure not to use string values when formatting perfdata

This commit is contained in:
Yonas Habteab 2022-08-05 09:56:49 +02:00 committed by Johannes Meyer
parent 9d962a239a
commit c5d5f1dfd3

View file

@ -117,6 +117,7 @@ class PerfDataFormat
public static function seconds($value): string
{
$value = (float) $value;
$absValue = abs($value);
if ($absValue < 60) {
@ -133,6 +134,7 @@ class PerfDataFormat
protected static function formatForUnits($value, array &$units, int $base): string
{
$sign = '';
$value = (float) $value;
if ($value < 0) {
$value = abs($value);
$sign = '-';