Skip to content

Commit

Permalink
Update src/humanize/time.py
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
  • Loading branch information
dansarpong and hugovk committed Oct 19, 2023
1 parent a197516 commit fe227a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/humanize/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ def precisedelta(
for unit, fmt in zip(reversed(Unit), fmts):
singular_txt, plural_txt, fmt_value = fmt
if fmt_value > 0 or (not texts and unit == min_unit):
_fmt_value = 2 if fmt_value > 1 and fmt_value < 2 else int(fmt_value)
_fmt_value = 2 if 1 < fmt_value < 2 else int(fmt_value)
fmt_txt = _ngettext(singular_txt, plural_txt, _fmt_value)
if unit == min_unit and math.modf(fmt_value)[0] > 0:
fmt_txt = fmt_txt.replace("%d", format)
Expand Down

0 comments on commit fe227a6

Please sign in to comment.