Commit 619c2ec8 authored by Tiago Peixoto's avatar Tiago Peixoto

Use kibibyte notation

parent 8c631c11
......@@ -72,11 +72,11 @@ def file_processor():
except FileNotFoundError:
return "N/A"
if size > 1024 ** 3:
size = f"{(size/1024**3):.3f}GB"
size = f"{(size/1024**3):.3f} GiB"
elif size > 1024 ** 2:
size = f"{(size/1024**2):.1f}MB"
size = f"{(size/1024**2):.1f} MiB"
elif size > 1024:
size = f"{round(size//1024)}KB"
size = f"{round(size//1024)} KiB"
else:
size = f"{size}B"
return size
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment