debrouwere / python-ballpark

Better human-readable numbers
ISC License
40 stars 14 forks source link

Cannot handle negative numbers? #11

Open afzalmushtaque opened 6 years ago

afzalmushtaque commented 6 years ago

'$'+ballpark.business(100000)

Out[23]: '$100K'

'$'+ballpark.business(-100000)

Traceback (most recent call last): File "C:\Python\Python36\lib\site-packages\IPython\core\interactiveshell.py", line 2963, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in '$'+ballpark.business(-100000) File "C:\Python\Python36\lib\site-packages\ballpark\utils.py", line 90, in unwrapped_function results = fn(values, *vargs, **kwargs) File "C:\Python\Python36\lib\site-packages\ballpark\notation.py", line 130, in business exponent = order(reference) File "C:\Python\Python36\lib\site-packages\ballpark\notation.py", line 18, in order power = log(repel(value), base) ValueError: math domain error