src/Debugger/Bar/TracePanel.php
public function bytes($bytes, $precision = 2)
    {
        $bytes = \round($bytes);
        $units = ['B', 'kB', 'MB', 'GB', 'TB', 'PB'];
        foreach ($units as $unit) {
            if (\abs($bytes) < 1024 || $unit === \end($units)) {
                break;
            }
            $bytes = $bytes / 1024;
        }

        return \round($bytes, $precision) . ' ' . $unit;
    }
public function bytes($bytes, $precision = 2)
    {
        $bytes = \round($bytes);
        $units = ['B', 'kB', 'MB', 'GB', 'TB', 'PB'];
        foreach ($units as $unit) {
            if (\abs($bytes) < 1024 || $unit === \end($units)) {
                break;
            }
            $bytes = $bytes / 1024;
        }

        return \round($bytes, $precision) . ' ' . $unit;
    }
public function bytes ( $ bytes , $ precision = 2 ) { $ bytes = \ round ( $ bytes ) ; $ units = [ 'B' , 'kB' , 'MB' , 'GB' , 'TB' , 'PB' ] ; foreach ( $ units as $ unit ) { if ( \ abs ( $ bytes ) < 1024 || $ unit === \ end ( $ units ) ) { break ; } $ bytes = $ bytes / 1024 ; } return \ round ( $ bytes , $ precision ) . ' ' . $ unit ; }
Converts to human readable file size.

@param  int
@param  int

@return string
Converts to human readable file size .