MCPcopy Create free account
hub / github.com/TechifyBots/Rename-Bot / humanbytes

Function humanbytes

helper/utils.py:37–46  ·  view source on GitHub ↗
(size)

Source from the content-addressed store, hash-verified

35 pass
36
37def humanbytes(size):
38 if not size:
39 return ""
40 power = 2**10
41 n = 0
42 Dic_powerN = {0: ' ', 1: 'K', 2: 'M', 3: 'G', 4: 'T'}
43 while size > power:
44 size /= power
45 n += 1
46 return str(round(size, 2)) + " " + Dic_powerN[n] + 'ʙ'
47
48def TimeFormatter(milliseconds: int) -> str:
49 seconds, milliseconds = divmod(int(milliseconds), 1000)

Callers 7

myplanFunction · 0.90
cb_handlerFunction · 0.90
rename_startFunction · 0.90
upload_docFunction · 0.90
get_statusFunction · 0.90
add_premiumFunction · 0.90
progress_for_pyrogramFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected