Copied from Lijtweg [doclist precursor] introduced in commit
v2.0-12-g040c5406df (2017-09-18) [com/bewoners: group file types by date];
unaltered since but no longer used. Could prove useful later, so move here
to merge identically named files and share with other projects.
]));
}
+function showsize($bytes)
+{
+ $units = ['', 'k', 'M', 'G', 'T'];
+ $log = strlen($bytes) - 1;
+ $order = floor($log / 3);
+ if (!isset($units[$order])) return $bytes;
+ return implode(' ', [
+ number_format($bytes / (1000 ** $order), $log % 3 ? 0 : 1, ',', ''),
+ $units[$order],
+ ]);
+}
+