diff --git a/web/includes/functions.php b/web/includes/functions.php index c2072a706..fe7d2ae77 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -2149,14 +2149,15 @@ function folder_size($dir) { } // end function folder_size function human_filesize($size, $precision = 2) { - $units = array('B','kB','MB','GB','TB','PB','EB','ZB','YB'); + $units = array('B ','kB','MB','GB','TB','PB','EB','ZB','YB'); $step = 1024; $i = 0; while (($size / $step) > 0.9) { $size = $size / $step; $i++; } - return round($size, $precision).$units[$i]; + # The idea is that we can right align this and have the digits columns line up nicely. + return sprintf('%.'.$precision.'f', round($size, $precision)).$units[$i]; } function csrf_startup() {