Fixed calculation of petabytes
This commit is contained in:
parent
14324e56fe
commit
c562a5498e
@ -9,7 +9,7 @@ def convert_bytes(n: float) -> str:
|
|||||||
"""
|
"""
|
||||||
K, M, G, T, P = 1 << 10, 1 << 20, 1 << 30, 1 << 40, 1 << 50
|
K, M, G, T, P = 1 << 10, 1 << 20, 1 << 30, 1 << 40, 1 << 50
|
||||||
if n >= P:
|
if n >= P:
|
||||||
return "%.2fPb" % (float(n) / T)
|
return "%.2fPb" % (float(n) / P)
|
||||||
elif n >= T:
|
elif n >= T:
|
||||||
return "%.2fTb" % (float(n) / T)
|
return "%.2fTb" % (float(n) / T)
|
||||||
elif n >= G:
|
elif n >= G:
|
||||||
|
Loading…
Reference in New Issue
Block a user