From 5cfb80e98ca5d4ccb0366ec3950766d3dbfe251e Mon Sep 17 00:00:00 2001 From: Daniel Sarpong Date: Thu, 19 Oct 2023 09:18:07 +0000 Subject: [PATCH] Update src/humanize/time.py Co-authored-by: Hugo van Kemenade --- src/humanize/time.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/humanize/time.py b/src/humanize/time.py index 5acf7d6..52828c1 100644 --- a/src/humanize/time.py +++ b/src/humanize/time.py @@ -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)