Switch from binary bytes to SI-units

This commit is contained in:
Ribas160 2025-07-23 21:06:20 +03:00
parent 67e4eb74ed
commit 863cb89ad9
No known key found for this signature in database
GPG key ID: ED4AE99DCA25A6BB
43 changed files with 46 additions and 342 deletions

View file

@ -59,10 +59,10 @@ class Filter
*/
public static function formatHumanReadableSize($size)
{
$iec = array('B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB');
$iec = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
$i = 0;
while (($size / 1024) >= 1) {
$size = $size / 1024;
while (($size / 1000) >= 1) {
$size = $size / 1000;
++$i;
}
return number_format($size, $i ? 2 : 0, '.', ' ') . ' ' . I18n::_($iec[$i]);