public function formatBytes($size, $pre = 2)
    {
        $base = log($size) / log(1024);
        $suffix = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
        $f_base = floor($base);

        return round(pow(1024, $base - floor($base)), $pre).$suffix[$f_base];
    }
public function formatBytes($size, $pre = 2)
    {
        $base = log($size) / log(1024);
        $suffix = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
        $f_base = floor($base);

        return round(pow(1024, $base - floor($base)), $pre).$suffix[$f_base];
    }
public function formatBytes ( $ size , $ pre = 2 ) { $ base = log ( $ size ) / log ( 1024 ) ; $ suffix = [ 'B' , 'KB' , 'MB' , 'GB' , 'TB' , 'PB' ] ; $ f_base = floor ( $ base ) ; return round ( pow ( 1024 , $ base - floor ( $ base ) ) , $ pre ) . $ suffix [ $ f_base ] ; }
Formats the bytes in human readable form.

@param (int) $size The value that you want provided
@param (int) $pre  round the value default 2

@since 3.0.0

@return mixed
Formats the bytes in human readable form .