MCPcopy
hub / github.com/ArchiveBox/ArchiveBox / printable_filesize

Function printable_filesize

archivebox/logging_util.py:570–575  ·  view source on GitHub ↗
(num_bytes: Union[int, float])

Source from the content-addressed store, hash-verified

568
569@enforce_types
570def printable_filesize(num_bytes: Union[int, float]) -> str:
571 for count in ['Bytes','KB','MB','GB']:
572 if num_bytes > -1024.0 and num_bytes < 1024.0:
573 return '%3.1f %s' % (num_bytes, count)
574 num_bytes /= 1024.0
575 return '%3.1f %s' % (num_bytes, 'TB')
576
577
578@enforce_types

Callers 5

sizeMethod · 0.90
printable_folder_statusFunction · 0.85
statusFunction · 0.85
link_details_templateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected