This commit is contained in:
Merwane Hamadi
2023-04-17 13:47:38 -07:00
parent cf9a94a8b6
commit da65bc3f68
6 changed files with 33 additions and 20 deletions

View File

@@ -32,7 +32,7 @@ def readable_file_size(size, decimal_places=2):
size: Size in bytes
decimal_places (int): Number of decimal places to display
"""
for unit in ['B', 'KB', 'MB', 'GB', 'TB']:
for unit in ["B", "KB", "MB", "GB", "TB"]:
if size < 1024.0:
break
size /= 1024.0