From f5251d5b24fdfa0fe7362aad30147c666a82d43f Mon Sep 17 00:00:00 2001 From: kanoi Date: Thu, 21 Jul 2016 17:18:08 +1000 Subject: [PATCH] php - tidy up page header rounding --- pool/page.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pool/page.php b/pool/page.php index 5a556525..bf42ccfa 100644 --- a/pool/page.php +++ b/pool/page.php @@ -227,7 +227,7 @@ function pgtop($alert_marker, $info, $dotop, $user, $douser) else { $min = round($sec / 60); - $hr = round($min / 60); + $hr = floor($min / 60); $min -= ($hr * 60); $plb = $hr.'h'; if ($min > 0) @@ -247,10 +247,15 @@ function pgtop($alert_marker, $info, $dotop, $user, $douser) { $sec = $now - $nlb; $min = floor($sec / 60); - $nlb = $min.'m'; - $s = $sec - $min * 60; - if ($s > 0) - $nlb .= " ${s}s"; + if ($min > 0) + { + $nlb = $min.'m'; + $s = $sec - ($min * 60); + if ($s > 0) + $nlb .= " ${s}s"; + } + else + $nlb = "${sec}s"; } }