src/WebFilesystem/WebFilesystem.php
public static function getTransformedFilesize($size = 0, $round = 3, $dec_delimiter = ',')
    {
        $count=0;
        while ($size >= 1024 && $count < (count(self::$FILESIZE_ORDERED_UNITS)-1)) {
            $count++;
            $size /= 1024;
        }
        if ($round>=0) {
            $arr = pow(10, $round);
            $number = round($size * $arr) / $arr;
        } else {
            $number = $size;
        }
        return str_replace('.', $dec_delimiter, $number).' '.self::$FILESIZE_ORDERED_UNITS[$count];
    }
public static function getTransformedFilesize($size = 0, $round = 3, $dec_delimiter = ',')
    {
        $count=0;
        while ($size >= 1024 && $count < (count(self::$FILESIZE_ORDERED_UNITS)-1)) {
            $count++;
            $size /= 1024;
        }
        if ($round>=0) {
            $arr = pow(10, $round);
            $number = round($size * $arr) / $arr;
        } else {
            $number = $size;
        }
        return str_replace('.', $dec_delimiter, $number).' '.self::$FILESIZE_ORDERED_UNITS[$count];
    }
public static function getTransformedFilesize ( $ size = 0 , $ round = 3 , $ dec_delimiter = ',' ) { $ count = 0 ; while ( $ size >= 1024 && $ count < ( count ( self :: $ FILESIZE_ORDERED_UNITS ) - 1 ) ) { $ count ++ ; $ size /= 1024 ; } if ( $ round >= 0 ) { $ arr = pow ( 10 , $ round ) ; $ number = round ( $ size * $ arr ) / $ arr ; } else { $ number = $ size ; } return str_replace ( '.' , $ dec_delimiter , $ number ) . ' ' . self :: $ FILESIZE_ORDERED_UNITS [ $ count ] ; }
Returns a formatted file size in bytes or derived unit

This will return the size received transforming it to be readable, with the appropriate
unit chosen in `WebFilesystem::$FILESIZE_ORDERED_UNITS`.

@param float $size Refer to the size (in standard format given by the `stat()` function)
@param int $round The number of decimal places (default is 3)
@param string $dec_delimiter The decimal separator (default is a comma)
Returns a formatted file size in bytes or derived unit