1
0
Fork 0
mirror of synced 2024-07-01 20:50:34 +12:00

Utils: return correct value type string for get_size()

This commit is contained in:
loathingKernel 2023-02-17 13:23:44 +02:00
parent 922b1472dd
commit da49a91a03

View file

@ -144,9 +144,9 @@ def get_latest_version():
def get_size(b: Union[int, float]) -> str: def get_size(b: Union[int, float]) -> str:
for i in ["", "K", "M", "G", "T", "P", "E"]: for s in ["", "K", "M", "G", "T", "P", "E"]:
if b < 1024: if b < 1024:
return f"{b:.2f}{i}B" return f"{b:.2f} {s}iB"
b /= 1024 b /= 1024