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.
1 parent 2473d6d commit 9ff98f7Copy full SHA for 9ff98f7
src/humanize/time.py
@@ -526,12 +526,8 @@ def precisedelta(
526
years, days = _quotient_and_remainder(days, 365, YEARS, min_unit, suppress_set)
527
months, days = _quotient_and_remainder(days, 30.5, MONTHS, min_unit, suppress_set)
528
529
- # If DAYS is not in suppress, we can represent the days but
530
- # if it is a suppressed unit, we need to carry it to a lower unit,
531
- # seconds in this case.
532
- #
533
- # The same applies for secs and usecs below
534
- days, secs = _carry(days, secs, 24 * 3600, DAYS, min_unit, suppress_set)
+ secs = days * 24 * 3600 + secs
+ days, secs = _quotient_and_remainder(secs, 24 * 3600, DAYS, min_unit, suppress_set)
535
536
hours, secs = _quotient_and_remainder(secs, 3600, HOURS, min_unit, suppress_set)
537
minutes, secs = _quotient_and_remainder(secs, 60, MINUTES, min_unit, suppress_set)
0 commit comments