From c4d16e250dd1130bab113911c388d183096223a6 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 14 Mar 2023 18:41:19 +0530 Subject: [PATCH] Fixes math error for negative size in diff view in archive tab Signed-off-by: Chirag Aggarwal --- src/vorta/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vorta/utils.py b/src/vorta/utils.py index 6217fb518..3bab52a72 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -266,7 +266,7 @@ def find_best_unit_for_size(size: Optional[int], metric: bool = True, precision: if not isinstance(size, int) or size == 0: # this will also take care of the None case return 0 power = 10**3 if metric else 2**10 - n = math.floor(math.log(size * 10**precision, power)) + n = math.floor(math.log(abs(size) * 10**precision, power)) return n