better comma placement
This commit is contained in:
parent
1f3dbcb6b6
commit
e67cc0d542
1 changed files with 3 additions and 2 deletions
|
@ -56,7 +56,8 @@ def timestampScreen(timestamp):
|
|||
|
||||
def timedeltaToString(time):
|
||||
"""Différence entre une heure en seconde et maintenant"""
|
||||
age = str(timedelta(seconds = time)).replace('day', 'jour').replace(', ', ', :').split(':')
|
||||
age = str(timedelta(seconds = time)).replace('day', 'jour').replace(', ', ':').split(':')
|
||||
print(age)
|
||||
if len(age) == 4:
|
||||
a = [1, 1, 1, 1] # a pour affichage
|
||||
if len(age) == 3:
|
||||
|
@ -66,7 +67,7 @@ def timedeltaToString(time):
|
|||
if int(age[i]) == 0:
|
||||
a[i] = 0
|
||||
age[0] = age[0] if a[0] == 1 else ''
|
||||
age[1] = f"{age[1]}h " if a[1] == 1 else ''
|
||||
age[1] = f", {age[1]}h " if a[1] == 1 else ''
|
||||
age[2] = f"{age[2]}m " if a[2] == 1 else ''
|
||||
age[3] = f"{age[3]}s" if a[3] == 1 else ''
|
||||
return ''.join(age).strip(' ')
|
||||
|
|
Reference in a new issue