MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / convert_bytes

Method convert_bytes

daily/quark.py:70–81  ·  view source on GitHub ↗

将字节转换为 MB GB TB :param b: 字节数 :return: 返回 MB GB TB

(self, b)

Source from the content-addressed store, hash-verified

68 self.param = user_data
69
70 def convert_bytes(self, b):
71 '''
72 将字节转换为 MB GB TB
73 :param b: 字节数
74 :return: 返回 MB GB TB
75 '''
76 units = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
77 i = 0
78 while b >= 1024 and i < len(units) - 1:
79 b /= 1024
80 i += 1
81 return f"{b:.2f} {units[i]}"
82
83 def get_growth_info(self):
84 ''&#x27;

Callers 1

do_signMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected