From 77c37c3f683751e9ad561091516a02b5f66f7a0f Mon Sep 17 00:00:00 2001 From: pezcurrel Date: Mon, 26 Feb 2024 17:52:46 +0100 Subject: [PATCH] Made it echo seconds if there are seconds left, or if ozero is true, or if no previous output was echoed --- web/lib/ght.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/lib/ght.php b/web/lib/ght.php index 0d7a5f7..df3dc09 100644 --- a/web/lib/ght.php +++ b/web/lib/ght.php @@ -70,7 +70,8 @@ $ozero is whether to include a zero value for a unit if ($buniti>=1) { if ($out!='') $osep=$sep; $x=round($ts,$sd); - ($x==1) ? $out.=$osep.$x.' '.$fa[$i] : $out.=$osep.$x.' '.$fa[$i+1]; + if ($x>0 || $ozero || $out=='') + ($x==1) ? $out.=$osep.$x.' '.$fa[$i] : $out.=$osep.$x.' '.$fa[$i+1]; } return $out; }