X-Git-Url: https://git.immae.eu/?p=perso%2FDenise%2Foms.git;a=blobdiff_plain;f=gestion_donnees.py;h=71c96231c6c9ba6fe78d5bdc8f2736fc4b7ccbb1;hp=2ba945df04aed47c62d15bda6d4c6c33362b2825;hb=a46e126967995e8483b4da81a1f3b586266ee86d;hpb=5679dfd03c9761283e3a36d6d09798aaa334e1e9 diff --git a/gestion_donnees.py b/gestion_donnees.py index 2ba945d..71c9623 100644 --- a/gestion_donnees.py +++ b/gestion_donnees.py @@ -51,9 +51,9 @@ def convertit_age_vers_texte(nombre): """ convertit un nombre de jours en un truc plus lisible en mois, années, jours et renvoie une chaîne sous la forme 3a2m1j par exemple""" annees = int(nombre / jours_dans_annee) - restant = nombre - int(annees*jours_dans_annee) + restant = nombre - round(annees*jours_dans_annee) mois = int(restant/jours_dans_mois) - jours= restant - int(mois*jours_dans_mois) + jours= nombre - round(mois*jours_dans_mois + annees*jours_dans_annee) chaine = "" if annees >0: @@ -73,12 +73,12 @@ def convertit_poids_vers_python(chaine,liste_err): chaine2 = chaine2.replace(" ","") try: - poids = float(chaine) + poids = float(chaine2) except: warning("Poids impossible à lire : "+chaine,liste_err) poids = 0 - if not( 0