private function formatBytes($bytes, $precision = 2)
    {
        $unit = array('B','KB','MB','GB','TB','PB','EB');

        if (!$bytes) {
            return "0 B";
        }

        return @round(
            $bytes / pow(1024, ($i = floor(log($bytes, 1024)))), $precision
        ).' '.$unit[$i];
    }
private function formatBytes($bytes, $precision = 2)
    {
        $unit = array('B','KB','MB','GB','TB','PB','EB');

        if (!$bytes) {
            return "0 B";
        }

        return @round(
            $bytes / pow(1024, ($i = floor(log($bytes, 1024)))), $precision
        ).' '.$unit[$i];
    }
private function formatBytes ( $ bytes , $ precision = 2 ) { $ unit = array ( 'B' , 'KB' , 'MB' , 'GB' , 'TB' , 'PB' , 'EB' ) ; if ( ! $ bytes ) { return "0 B" ; } return @ round ( $ bytes / pow ( 1024 , ( $ i = floor ( log ( $ bytes , 1024 ) ) ) ) , $ precision ) . ' ' . $ unit [ $ i ] ; }
formats a bigint into a human readable size

@param int $size
@param int $precision
@return string
formats a bigint into a human readable size