Skip to content

Commit

Permalink
fix issue in reporting of time since last backup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Kundert authored and Ken Kundert committed Apr 1, 2023
1 parent ae035ac commit e633025
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions emborg/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,9 @@ def when(time, relative_to=None, as_past=None, as_future=None):
seconds = 60*60*24*difference.days + difference.seconds

def fmt(dt, prec, unit):
if prec:
num = f'{dt:0.1f}'.rstrip('.0')
else:
num = f'{dt:0.0f}'
num = f'{dt:0.{prec}f}'
if '.' in num:
num = num.rstrip('0').rstrip('.')
if num == '1':
offset = f'{num} {unit}'
else:
Expand Down

0 comments on commit e633025

Please sign in to comment.