Closed
Description
@CellKai made this method already, it would be nice to integrate it to the libs.
def convert_bytes(size):
"""Convert size from bytes to a readable value
Parameters
----------
size : int
Byte size
Returns
-------
str
Easy to read value with the correct unit
"""
for x in ["bytes", "KB", "MB", "GB", "TB"]:
if size < 1024.0:
return "%3.1f %s" % (size, x)
size /= 1024.0
return size
Metadata
Metadata
Assignees
Type
Projects
Status
Done