Limit humanize output to 2 decimal places
parent
e464898210
commit
722b515246
|
@ -16,7 +16,7 @@ def humanize(number):
|
||||||
if mag < 3:
|
if mag < 3:
|
||||||
return number
|
return number
|
||||||
maxmag = max(itertools.takewhile(lambda key: mag >= key, mag2suffix))
|
maxmag = max(itertools.takewhile(lambda key: mag >= key, mag2suffix))
|
||||||
return "{:.3f}{}".format(number/10**maxmag, mag2suffix[maxmag])
|
return "{:.2f}{}".format(number/10**maxmag, mag2suffix[maxmag])
|
||||||
|
|
||||||
|
|
||||||
def percent_change(init, new):
|
def percent_change(init, new):
|
||||||
|
|
Loading…
Reference in New Issue