Fixed #1296 formatting numbers on the admin health page

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO
2023-05-27 16:42:48 +02:00
parent c2b20a01eb
commit 5fbefb28a5
3 changed files with 100 additions and 95 deletions

View File

@ -291,6 +291,11 @@ function my_qp_encode($s){
}
function format_number($n) {
return number_format($n, 0, DECIMAL_SEPARATOR, THOUSANDS_SEPARATOR);
}
function nice_size($size = 0, $space = '') {
if($size < 1000) return "1k";
if($size < 1000000) return round($size/1000) . $space . "k";