temptours+tours
This commit is contained in:
16
engine/utils.py
Normal file
16
engine/utils.py
Normal file
@ -0,0 +1,16 @@
|
||||
from decimal import Decimal
|
||||
|
||||
|
||||
def format_temps_decimal(d):
|
||||
"""
|
||||
Formatte un Decimal représentant un nombre de secondes
|
||||
en HH:MM:SS.mmm — exemple : 00:06:52.820
|
||||
"""
|
||||
d = Decimal(d)
|
||||
total_sec = float(d)
|
||||
|
||||
hours = int(total_sec // 3600)
|
||||
minutes = int((total_sec % 3600) // 60)
|
||||
seconds = total_sec % 60
|
||||
|
||||
return f"{hours:02d}:{minutes:02d}:{seconds:06.3f}"
|
||||
Reference in New Issue
Block a user