From 64dbe31898bb192b133320f40977a1113fcc6274 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Wed, 28 Oct 2015 18:41:12 +0900 Subject: [PATCH] TimeString function: remove leading 0 for microseconds --- www/libs/Class.Basic.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/www/libs/Class.Basic.inc b/www/libs/Class.Basic.inc index d0547d0e..700f2af9 100644 --- a/www/libs/Class.Basic.inc +++ b/www/libs/Class.Basic.inc @@ -1055,6 +1055,8 @@ if ($output || $time_string) $time_string .= $output.$labels[$i].(($i + 1) != count($timegroups) ? ' ' : ''); } + // if we have ms and it has leading zeros, remove them + $ms = preg_replace("/^0+/", '', $ms); // add ms if there if ($show_micro) $time_string .= ' '.(!$ms ? 0 : $ms).'ms';