private function formatSize($bytes)
    {
        $units = ['B', 'KB', 'MB', 'GB', 'TB'];

        $bytes = max($bytes, 0);
        $pow = $bytes ? floor(log($bytes, 1024)) : 0;
        $pow = min($pow, count($units) - 1);

        $bytes /= pow(1024, $pow);

        return number_format($bytes, 2).' '.$units[$pow];
    }
private function formatSize($bytes)
    {
        $units = ['B', 'KB', 'MB', 'GB', 'TB'];

        $bytes = max($bytes, 0);
        $pow = $bytes ? floor(log($bytes, 1024)) : 0;
        $pow = min($pow, count($units) - 1);

        $bytes /= pow(1024, $pow);

        return number_format($bytes, 2).' '.$units[$pow];
    }
private function formatSize ( $ bytes ) { $ units = [ 'B' , 'KB' , 'MB' , 'GB' , 'TB' ] ; $ bytes = max ( $ bytes , 0 ) ; $ pow = $ bytes ? floor ( log ( $ bytes , 1024 ) ) : 0 ; $ pow = min ( $ pow , count ( $ units ) - 1 ) ; $ bytes /= pow ( 1024 , $ pow ) ; return number_format ( $ bytes , 2 ) . ' ' . $ units [ $ pow ] ; }
Utility method to show the number of bytes in a readable format.

@param int $bytes The number of bytes to format.

@return string The human readable string of bytes (e.g. 4.32MB).
Utility method to show the number of bytes in a readable format .