pyzte5g/models/base.py
def _bytes_to_human(self, size_bytes: int) -> str:
        """
            Convert bytes value to human readable format.
            Source: https://stackoverflow.com/a/14822210
        """
        if size_bytes == 0:
            return "0B"
        size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
        i = int(math.floor(math.log(size_bytes, 1024)))
        p = math.pow(1024, i)
        s = round(size_bytes / p, 2)
        return "%s %s" % (s, size_name[i])

            Convert bytes value to human readable format.
            Source: https://stackoverflow.com/a/14822210
        
Convert bytes value to human readable format.
Convert bytes value to human readable format .
def _bytes_to_human(self, size_bytes: int) -> str:
        if size_bytes == 0:
            return "0B"
        size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
        i = int(math.floor(math.log(size_bytes, 1024)))
        p = math.pow(1024, i)
        s = round(size_bytes / p, 2)
        return "%s %s" % (s, size_name[i])
def _bytes_to_human ( self , size_bytes : int ) -> str : if size_bytes == 0 : return "0B" size_name = ( "B" , "KB" , "MB" , "GB" , "TB" , "PB" , "EB" , "ZB" , "YB" ) i = int ( math . floor ( math . log ( size_bytes , 1024 ) ) ) p = math . pow ( 1024 , i ) s = round ( size_bytes / p , 2 ) return "%s %s" % ( s , size_name [ i ] )
Convert bytes value to human readable format.
Convert bytes value to human readable format .
"""
            Convert bytes value to human readable format.
            Source: https://stackoverflow.com/a/14822210
        """
self
size_bytes
int