Jelajahi Sumber

refactor: remove unused humanize_bytes function from size.py

Manuel 1 tahun lalu
induk
melakukan
7f0e9e670f
1 mengubah file dengan 0 tambahan dan 21 penghapusan
  1. 0 21
      utils/size.py

+ 0 - 21
utils/size.py

@@ -13,24 +13,3 @@ def size_to_bytes(size_str):
         "TB": 1024**4,
     }
     return int(value * multipliers.get(unit, 1))
-
-
-def humanize_bytes(bytes_value):
-    if not bytes_value or bytes_value == 0:
-        return "0 B"
-
-    units = ["B", "KB", "MB", "GB", "TB", "PB"]
-    size = float(bytes_value)
-    unit_index = 0
-
-    while size >= 1024 and unit_index < len(units) - 1:
-        size /= 1024
-        unit_index += 1
-
-    if unit_index == 0:
-        return f"{int(size)} {units[unit_index]}"
-
-    if size == int(size):
-        return f"{int(size)} {units[unit_index]}"
-    else:
-        return f"{size:.1f} {units[unit_index]}"