Fix division by zero error
This commit is contained in:
parent
6afea91c5f
commit
70e1af15cc
@ -73,7 +73,7 @@ def percent_change_display(start, end):
|
|||||||
elif start == 0:
|
elif start == 0:
|
||||||
pct_change = "0%"
|
pct_change = "0%"
|
||||||
else:
|
else:
|
||||||
change = int(round(100 * abs(end - start) / start))
|
change = int(round(100 * abs(end - start) / max(start, 1)))
|
||||||
if change > 999:
|
if change > 999:
|
||||||
return "> 999%"
|
return "> 999%"
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user