protected function getReadableBytes($bytes, $precision)
    {
        $suffix = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
        $total = count($suffix);

        for ($i = 0; $bytes > 1024 && $i < $total; $i++) {
            $bytes /= 1024;
        }

        return number_format($bytes, $precision) . ' ' . $suffix[$i];
    }
protected function getReadableBytes($bytes, $precision)
    {
        $suffix = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
        $total = count($suffix);

        for ($i = 0; $bytes > 1024 && $i < $total; $i++) {
            $bytes /= 1024;
        }

        return number_format($bytes, $precision) . ' ' . $suffix[$i];
    }
protected function getReadableBytes ( $ bytes , $ precision ) { $ suffix = array ( 'B' , 'kB' , 'MB' , 'GB' , 'TB' , 'PB' , 'EB' , 'ZB' , 'YB' ) ; $ total = count ( $ suffix ) ; for ( $ i = 0 ; $ bytes > 1024 && $ i < $ total ; $ i ++ ) { $ bytes /= 1024 ; } return number_format ( $ bytes , $ precision ) . ' ' . $ suffix [ $ i ] ; }
Returns a human-readable representation of the given byte count.

@param integer $bytes     Byte count to convert.
@param integer $precision How many decimals to include.

@return string
Returns a human - readable representation of the given byte count .