klydekushy commited on
Commit
945124e
·
verified ·
1 Parent(s): 10b459d

Update src/Analytics/AnalyseFinance.py

Browse files
Files changed (1) hide show
  1. src/Analytics/AnalyseFinance.py +3 -7
src/Analytics/AnalyseFinance.py CHANGED
@@ -40,7 +40,7 @@ def clean_currency_value(val):
40
  def clean_taux_value(val):
41
  """
42
  Convertit un taux correctement.
43
- Gère : "5,3" → 5.3 | "5.3" → 5.3 | 535.3
44
  """
45
  try:
46
  if isinstance(val, str):
@@ -49,12 +49,8 @@ def clean_taux_value(val):
49
 
50
  taux = float(val)
51
 
52
- # Si le taux semble anormalement élevé (ex: 53 au lieu de 5.3)
53
- # On divise par 10
54
- if taux > 20:
55
- taux = taux / 10
56
-
57
- return round(taux, 2) # Arrondi à 2 décimales
58
  except (ValueError, AttributeError, TypeError):
59
  return 0.0
60
 
 
40
  def clean_taux_value(val):
41
  """
42
  Convertit un taux correctement.
43
+ Gère : "5,3" → 5.3 | "5.3" → 5.3 | "19,68"19.68
44
  """
45
  try:
46
  if isinstance(val, str):
 
49
 
50
  taux = float(val)
51
 
52
+ # Retourner le taux tel quel (plus de division automatique)
53
+ return round(taux, 2)
 
 
 
 
54
  except (ValueError, AttributeError, TypeError):
55
  return 0.0
56