Fix intword's decillion-to-googol gap and carry-over rounding - #364
Fix intword's decillion-to-googol gap and carry-over rounding#364mmaxjr wants to merge 2 commits into
intword's decillion-to-googol gap and carry-over rounding#364Conversation
`powers` jumps from decillion (10**33) directly to googol (10**100), so any value in [10**36, 10**100) was chopped into a decillion count that grew arbitrarily large (e.g. 10**50 -> "100000000000000000.0 decillion"), and values that should round up into googol (e.g. 10**100 - 10**93) never carried over. Only advance to the next named unit when the value actually rounds up to it; otherwise there is no unit for that magnitude, so fall back to the plain integer, mirroring how intword() already falls back to a plain value below the smallest unit. Fixes python-humanize#356 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
intword's decillion-to-googol gap and carry-over rounding
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #364 +/- ##
==========================================
- Coverage 99.56% 95.44% -4.12%
==========================================
Files 12 12
Lines 916 923 +7
==========================================
- Hits 912 881 -31
- Misses 4 42 +38
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Status update on 2026-08-06: the latest commit (702e631) keeps the English fallback for unnamed magnitudes while preserving translated local-scale units such as French quintilliard(s).\n\nCurrent GitHub Actions runs for this fork update are in �ction_required, so the full matrix needs maintainer approval to run. The external checks currently visible on the PR are green:\n\n- docs/readthedocs.org:humanize -> success\n- pre-commit.ci - pr -> success |
Fixes #356
Problem
intword()'spowerstable jumps straight from decillion (10**33) to googol (10**100), with no unit in between. Any value in [10**36,10**100) got chopped into a decillion count that grows arbitrarily large: