Skip to content

fix: handle decimal string input in intword()#332

Open
jtvhd6 wants to merge 1 commit into
python-humanize:mainfrom
jtvhd6:main
Open

fix: handle decimal string input in intword()#332
jtvhd6 wants to merge 1 commit into
python-humanize:mainfrom
jtvhd6:main

Conversation

@jtvhd6

@jtvhd6 jtvhd6 commented Jun 27, 2026

Copy link
Copy Markdown

Bug: intword("12400.9") returns "12400.9" instead of "12.4 thousand" because int("12400.9") raises a ValueError in Python.
Fix: Changed value = int(value) to value = int(float(value)) so decimal strings are handled correctly, consistent with how intcomma() already handles this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant