Fix division by zero error

This commit is contained in:
R. Miles McCain 2021-01-10 12:17:53 -05:00
parent 6afea91c5f
commit 70e1af15cc
No known key found for this signature in database
GPG Key ID: F1053629E2905557

View File

@ -73,7 +73,7 @@ def percent_change_display(start, end):
elif start == 0:
pct_change = "0%"
else:
change = int(round(100 * abs(end - start) / start))
change = int(round(100 * abs(end - start) / max(start, 1)))
if change > 999:
return "> 999%"
else: