public static function fileSize($size)
    {
        $units = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'];

        for ($i = 0; $size > 1024; $i++) {
            $size /= 1024;
        }

        return __('Size unit ' . $units[$i], round($size, 2));
    }
public static function fileSize($size)
    {
        $units = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'];

        for ($i = 0; $size > 1024; $i++) {
            $size /= 1024;
        }

        return __('Size unit ' . $units[$i], round($size, 2));
    }
public static function fileSize ( $ size ) { $ units = [ 'B' , 'KiB' , 'MiB' , 'GiB' , 'TiB' , 'PiB' , 'EiB' ] ; for ( $ i = 0 ; $ size > 1024 ; $ i ++ ) { $ size /= 1024 ; } return __ ( 'Size unit ' . $ units [ $ i ] , round ( $ size , 2 ) ) ; }
Converts the file size in bytes to a human readable file size
@param $size
@return string
Converts the file size in bytes to a human readable file size