MCPcopy Create free account
hub / github.com/VJBots/VJ-File-Store / get_size

Function get_size

plugins/commands.py:32–41  ·  view source on GitHub ↗

Get size in readable format

(size)

Source from the content-addressed store, hash-verified

30
31
32def get_size(size):
33 """Get size in readable format"""
34
35 units = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB"]
36 size = float(size)
37 i = 0
38 while size >= 1024.0 and i < len(units):
39 i += 1
40 size /= 1024.0
41 return "%.2f %s" % (size, units[i])
42
43def formate_file_name(file_name):
44 chars = ["[", "]", "(", ")"]

Callers 1

startFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected