We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e7c75ef + fe227a6 commit c62340cCopy full SHA for c62340c
1 file changed
src/humanize/time.py
@@ -590,7 +590,8 @@ def precisedelta(
590
for unit, fmt in zip(reversed(Unit), fmts):
591
singular_txt, plural_txt, fmt_value = fmt
592
if fmt_value > 0 or (not texts and unit == min_unit):
593
- fmt_txt = _ngettext(singular_txt, plural_txt, fmt_value)
+ _fmt_value = 2 if 1 < fmt_value < 2 else int(fmt_value)
594
+ fmt_txt = _ngettext(singular_txt, plural_txt, _fmt_value)
595
if unit == min_unit and math.modf(fmt_value)[0] > 0:
596
fmt_txt = fmt_txt.replace("%d", format)
597
elif unit == YEARS:
0 commit comments