MCPcopy Create free account
hub / github.com/L0garithmic/FastColabCopy / sizeof_fmt

Function sizeof_fmt

fastcopy.py:11–16  ·  view source on GitHub ↗
(num, suffix='B')

Source from the content-addressed store, hash-verified

9
10
11def sizeof_fmt(num, suffix='B'):
12 for unit in ['', 'K', 'M', 'G']:
13 if abs(num) < 1000.0:
14 return "%3.1f%s%s" % (num, unit, suffix)
15 num /= 1000.0
16 return "%.1f%s%s" % (num, 'T', suffix)
17
18
19class FastCopy:

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected