From b417d81dc68d7839432744c4192bfa622275f1c9 Mon Sep 17 00:00:00 2001 From: Ambulance Clerc Date: Fri, 6 May 2022 11:54:59 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20affichage=20heure=20en=20centi=C3=A8me?= =?UTF-8?q?=20dans=20le=20d=C3=A9compte=20annuelle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- collabs/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/collabs/models.py b/collabs/models.py index 779cb14..6fc0256 100644 --- a/collabs/models.py +++ b/collabs/models.py @@ -66,8 +66,10 @@ class Collabs_hour(models.Model): if total > 0.0: hours = int(total) minutes = (total*60) % 60 + cent_min = float(minutes/60) + hours + print(f"{minutes}/60= {float(minutes/60)} {hours}+{float(minutes/60)}={cent_min}") - ret_string = ("%d:%02d" % (hours, minutes)) + ret_string = ("%d:%02d (%.2f)" % (hours, minutes, cent_min)) #ret_string = str(int(math.floor(total))) + ':' + str(int((total%(math.floor(total)))*60)) + f" ({total})" #ret_string = time.strftime("%H:%M", time.gmtime(total)) else: