From 95c6ecf8b41370f2464e421e090430872a6a4cf9 Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Fri, 12 Apr 2024 15:13:28 +0200 Subject: [PATCH] clearer numbers --- src/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils.py b/src/utils.py index f7ad115..0854dd7 100644 --- a/src/utils.py +++ b/src/utils.py @@ -5,10 +5,10 @@ def convert_to_bytes(size: int | str) -> int: return int(size) except ValueError: # treat as string units = { - 'TB': 10 ** 12, 'TiB': 2 ** 40, - 'GB': 10 ** 9, 'GiB': 2 ** 30, - 'MB': 10 ** 6, 'MiB': 2 ** 20, - 'KB': 10 ** 3, 'KiB': 2 ** 10, + 'TB': 1000 ** 4, 'TiB': 1024 ** 4, + 'GB': 1000 ** 3, 'GiB': 1024 ** 3, + 'MB': 1000 ** 2, 'MiB': 1024 ** 2, + 'KB': 1000, 'KiB': 1024, 'B': 1 }