Browse Source

Merge branch 'master' of https://github.com/ramandel/pygal into ramandel-master

Conflicts:
	pygal/util.py
pull/185/head
Florian Mounier 10 years ago
parent
commit
6859b14103
  1. 2
      pygal/util.py

2
pygal/util.py

@ -40,7 +40,7 @@ def humanize(number):
"""Format a number to engineer scale""" """Format a number to engineer scale"""
if is_list_like(number): if is_list_like(number):
return', '.join(map(humanize, number)) return', '.join(map(humanize, number))
order = number and int(floor(log(abs(number)) / log(1000))) order = number and int(log10(abs(number)) / 3.0)
human_readable = ORDERS.split(" ")[int(order > 0)] human_readable = ORDERS.split(" ")[int(order > 0)]
if order == 0 or order > len(human_readable): if order == 0 or order > len(human_readable):
return float_format(number / (1000 ** int(order))) return float_format(number / (1000 ** int(order)))

Loading…
Cancel
Save