protected static function _formatSize($bytes)
    {
        $exp    = 0;
        $value  = 0;
        $symbol = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');

        if ($bytes > 0) {
            $exp   = floor(log($bytes) / log(1024));
            $value = ($bytes / pow(1024, floor($exp)));
        }

        return sprintf('%.2f ' . $symbol[$exp], $value);
    }
protected static function _formatSize($bytes)
    {
        $exp    = 0;
        $value  = 0;
        $symbol = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');

        if ($bytes > 0) {
            $exp   = floor(log($bytes) / log(1024));
            $value = ($bytes / pow(1024, floor($exp)));
        }

        return sprintf('%.2f ' . $symbol[$exp], $value);
    }
protected static function _formatSize ( $ bytes ) { $ exp = 0 ; $ value = 0 ; $ symbol = array ( 'B' , 'KB' , 'MB' , 'GB' , 'TB' , 'PB' , 'EB' , 'ZB' , 'YB' ) ; if ( $ bytes > 0 ) { $ exp = floor ( log ( $ bytes ) / log ( 1024 ) ) ; $ value = ( $ bytes / pow ( 1024 , floor ( $ exp ) ) ) ; } return sprintf ( '%.2f ' . $ symbol [ $ exp ] , $ value ) ; }
Convert filesize to formated string
@param   integer $bytes Count bytes
@return  string
Convert filesize to formated string