Zero bad fields
parent
995851360d
commit
3a40c2f8fe
|
@ -27,4 +27,6 @@ def percent_change(init, new):
|
||||||
"""Calcuate the percentage change of some ``new`` value
|
"""Calcuate the percentage change of some ``new`` value
|
||||||
from some initial value, ``init``.
|
from some initial value, ``init``.
|
||||||
"""
|
"""
|
||||||
|
if not (init and new):
|
||||||
|
return 0
|
||||||
return (new - init) / init * 100.
|
return (new - init) / init * 100.
|
||||||
|
|
Loading…
Reference in New Issue