From fb852ed92d1080dc14ffb444f47bb8fde2783fd2 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Wed, 11 Jan 2023 19:57:35 +0100 Subject: [PATCH] fix unit conversion --- main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index bb8047a..0a8d205 100755 --- a/main.py +++ b/main.py @@ -84,10 +84,10 @@ class Throughput: # Units sorted from small to large. _unit_dict = { 'B': 1, - 'KB': 10 ** 3, - 'MB': 10 ** 6, - 'GB': 10 ** 9, - 'TB': 10 ** 12, + 'KB': 1024, + 'MB': 1024 * 1024, + 'GB': 1024 * 1024 * 1024, + 'TB': 1024 * 1024 * 1024 * 1024, } @classmethod