Use .format to format file sizes again

This commit is contained in:
Micah Lee 2019-10-20 18:14:00 -07:00
parent 8dd60eed78
commit 057bb40a92
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -437,7 +437,7 @@ class Common(object):
"""
thresh = 1024.0
if b < thresh:
return f"{b} B"
return "{:.1f} B".format(b)
units = ("KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB")
u = 0
b /= thresh