protected function formatBytes($bytes): string
    {
        $suffix = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];

        $p = min((int)log($bytes, 1024), count($suffix) - 1);

        return sprintf('%1.2f%s', ($bytes / pow(1024, $p)), $suffix[$p]);
    }
protected function formatBytes($bytes): string
    {
        $suffix = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];

        $p = min((int)log($bytes, 1024), count($suffix) - 1);

        return sprintf('%1.2f%s', ($bytes / pow(1024, $p)), $suffix[$p]);
    }
protected function formatBytes ( $ bytes ) : string { $ suffix = [ 'B' , 'KB' , 'MB' , 'GB' , 'TB' , 'PB' , 'EB' , 'ZB' , 'YB' ] ; $ p = min ( ( int ) log ( $ bytes , 1024 ) , count ( $ suffix ) - 1 ) ; return sprintf ( '%1.2f%s' , ( $ bytes / pow ( 1024 , $ p ) ) , $ suffix [ $ p ] ) ; }
Format bytes to human readable format

@param number $bytes

@return string
Format bytes to human readable format