From 1b3601ce871c65942d0218e5feefb0d335adc8c3 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Thu, 15 Aug 2024 17:55:11 +0200 Subject: [PATCH] =?UTF-8?q?Corrige=20le=20filtre=20FILTER=5FFLOAT:=20pour?= =?UTF-8?q?=20la=20g=C3=A9olocalisation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/class/helper.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/class/helper.class.php b/core/class/helper.class.php index 7cf0c60e..da8c3a57 100644 --- a/core/class/helper.class.php +++ b/core/class/helper.class.php @@ -432,7 +432,8 @@ class helper $text = (int) $date->format('U'); break; case self::FILTER_FLOAT: - $text = filter_var($text, FILTER_SANITIZE_NUMBER_FLOAT); + $text = str_replace(',', '.', $text); // Remplacer les virgules par des points + $text = filter_var($text, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); $text = (float) $text; break; case self::FILTER_ID: