Skip to content

Commit

Permalink
Fixes math error for negative size in diff view in archive tab
Browse files Browse the repository at this point in the history
Signed-off-by: Chirag Aggarwal <thechiragaggarwal@gmail.com>
  • Loading branch information
jetchirag authored and Hofer-Julian committed Mar 14, 2023
1 parent 6bc5321 commit c4d16e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vorta/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit c4d16e2

Please sign in to comment.