clearer numbers
This commit is contained in:
parent
f34cd88de1
commit
95c6ecf8b4
@ -5,10 +5,10 @@ def convert_to_bytes(size: int | str) -> int:
|
|||||||
return int(size)
|
return int(size)
|
||||||
except ValueError: # treat as string
|
except ValueError: # treat as string
|
||||||
units = {
|
units = {
|
||||||
'TB': 10 ** 12, 'TiB': 2 ** 40,
|
'TB': 1000 ** 4, 'TiB': 1024 ** 4,
|
||||||
'GB': 10 ** 9, 'GiB': 2 ** 30,
|
'GB': 1000 ** 3, 'GiB': 1024 ** 3,
|
||||||
'MB': 10 ** 6, 'MiB': 2 ** 20,
|
'MB': 1000 ** 2, 'MiB': 1024 ** 2,
|
||||||
'KB': 10 ** 3, 'KiB': 2 ** 10,
|
'KB': 1000, 'KiB': 1024,
|
||||||
'B': 1
|
'B': 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user