Browse Source

php - tidy up page header rounding

master
kanoi 8 years ago
parent
commit
f5251d5b24
  1. 15
      pool/page.php

15
pool/page.php

@ -227,7 +227,7 @@ function pgtop($alert_marker, $info, $dotop, $user, $douser)
else else
{ {
$min = round($sec / 60); $min = round($sec / 60);
$hr = round($min / 60); $hr = floor($min / 60);
$min -= ($hr * 60); $min -= ($hr * 60);
$plb = $hr.'h'; $plb = $hr.'h';
if ($min > 0) if ($min > 0)
@ -247,10 +247,15 @@ function pgtop($alert_marker, $info, $dotop, $user, $douser)
{ {
$sec = $now - $nlb; $sec = $now - $nlb;
$min = floor($sec / 60); $min = floor($sec / 60);
$nlb = $min.'m'; if ($min > 0)
$s = $sec - $min * 60; {
if ($s > 0) $nlb = $min.'m';
$nlb .= " ${s}s"; $s = $sec - ($min * 60);
if ($s > 0)
$nlb .= " ${s}s";
}
else
$nlb = "${sec}s";
} }
} }

Loading…
Cancel
Save