Skip to content

Commit

Permalink
timedelta fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiDuncan committed Jun 9, 2024
1 parent 3b1251a commit 1474844
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sizebot/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ def pretty_time_delta(totalSeconds: Decimal, millisecondAccuracy: bool = False,
if roundeventually and maxtime is not None and duration >= maxtime:
continue
if millisecondAccuracy and fraction:
s += f"{value:,d}.{remaining:03d} second{_s(value, remaining)}"
s += f"{value:,d}.{remaining:03d} second{_s(value, remaining)}, "
else:
s += f"{value:,d} {name}{_s(value)}"
return s
s += f"{value:,d} {name}{_s(value)}, "
return s.rstrip(", ")

def _s(value: int, fraction: int = 0) -> str:
if value != 1 or fraction != 0:
Expand Down Expand Up @@ -370,4 +370,4 @@ def round_fraction(number: Decimal, denominator: int) -> Decimal:
round_fraction(1.8, 4) == 1.75
"""
rounded = round(number * denominator) / denominator
return rounded
return rounded

0 comments on commit 1474844

Please sign in to comment.