MCPcopy
hub / github.com/pyload/pyload / formatSize

Function formatSize

module/utils.py:91–99  ·  view source on GitHub ↗

formats size of bytes

(size)

Source from the content-addressed store, hash-verified

89
90
91def formatSize(size):
92 """formats size of bytes"""
93 size = int(size)
94 steps = 0
95 sizes = ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"]
96 while size > 1000:
97 size /= 1024.0
98 steps += 1
99 return "%.2f %s" % (size, sizes[steps])
100
101
102def formatSpeed(speed):

Callers 15

startMethod · 0.90
renderHeaderMethod · 0.90
processCommandMethod · 0.90
printOnlineCheckMethod · 0.90
refreshServerStatusMethod · 0.90
formatSizeMethod · 0.90
getAllLinksMethod · 0.90
getLinkDataMethod · 0.90
getPackageDataMethod · 0.90
dataMethod · 0.90
paintMethod · 0.90
dataMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected