private function formatSize($bytes)
    {
        $unit = 1024;
        if ($bytes <= $unit) {
            return $bytes.' b';
        }
        $exp = (int)(log($bytes) / log($unit));
        $pre = 'kMGTPE';
        $pre = $pre[$exp - 1];

        return sprintf('%.1f %sB', $bytes / pow($unit, $exp), $pre);
    }
private function formatSize($bytes)
    {
        $unit = 1024;
        if ($bytes <= $unit) {
            return $bytes.' b';
        }
        $exp = (int)(log($bytes) / log($unit));
        $pre = 'kMGTPE';
        $pre = $pre[$exp - 1];

        return sprintf('%.1f %sB', $bytes / pow($unit, $exp), $pre);
    }
private function formatSize ( $ bytes ) { $ unit = 1024 ; if ( $ bytes <= $ unit ) { return $ bytes . ' b' ; } $ exp = ( int ) ( log ( $ bytes ) / log ( $ unit ) ) ; $ pre = 'kMGTPE' ; $ pre = $ pre [ $ exp - 1 ] ; return sprintf ( '%.1f %sB' , $ bytes / pow ( $ unit , $ exp ) , $ pre ) ; }
Format the size of a file.

@param int $bytes The number of bytes.

@return string
Format the size of a file .