Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metric(0) crashes #57

Closed
bersbersbers opened this issue Sep 21, 2022 · 3 comments
Closed

metric(0) crashes #57

bersbersbers opened this issue Sep 21, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@bersbersbers
Copy link

What did you do?

python -c "import humanize; humanize.metric(0)"

What did you expect to happen?

No crash

What actually happened?

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\bers\AppData\Local\Programs\Python\Python310\lib\site-packages\humanize\number.py", line 511, in metric
    exponent = int(math.floor(math.log10(abs(value))))
ValueError: math domain error

What versions are you using?

  • OS: Windows 10
  • Python: 3.10.7
  • Humanize: 4.3.0

Please include code that reproduces the issue.

import humanize
humanize.metric(0)
@bersbersbers
Copy link
Author

I see this has been fixed in #47. Looking forward to the next release :)

@hugovk
Copy link
Member

hugovk commented Sep 21, 2022

It's about time for a release, I've just released this in 4.4.0! 🚀

https://github.com/python-humanize/humanize/releases/tag/4.4.0
https://pypi.org/project/humanize/4.4.0/

@hugovk hugovk closed this as completed Sep 21, 2022
@hugovk hugovk added the bug Something isn't working label Sep 21, 2022
@bersbersbers
Copy link
Author

Thank you ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants