Skip to content

Commit

Permalink
Fix plural float error
Browse files Browse the repository at this point in the history
Fixed an error where a float value given in _ngettext generated errors
when expecting integer value
  • Loading branch information
dansarpong committed Oct 2, 2023
1 parent d9f6acd commit 93a7b18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/humanize/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _ngettext(message: str, plural: str, num: int) -> str:
Returns:
str: Translated text.
"""
return get_translation().ngettext(message, plural, num)
return get_translation().ngettext(message, plural, int(num))


def _gettext_noop(message: str) -> str:
Expand Down

0 comments on commit 93a7b18

Please sign in to comment.