You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
padelclub_backend/tournaments/utils/extensions.py

10 lines
276 B

def format_seconds(seconds):
hours = int(seconds / 3600)
minutes = int((seconds % 3600) / 60)
return f"{hours:02d}h{minutes:02d}min"
def plural_format(label, count):
if count < 2:
return f"{count} {label}"
else:
return f"{count} {label}s"