From c5019dfbdad695ff0ba54b5d6d7e80bdb040a1ab Mon Sep 17 00:00:00 2001 From: Francesco Picone Date: Sat, 6 Dec 2025 17:28:26 +0100 Subject: [PATCH] fix purchases.php --- includes/functions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index 17c3c96..4a7035d 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -548,7 +548,11 @@ function format_datetime($datetime) { * @return string Prezzo formattato */ function format_price($price) { - return '€ ' . number_format($price, 2, ',', '.'); + // Gestisci null o valori non numerici + if ($price === null || $price === '') { + $price = 0; + } + return '€ ' . number_format((float)$price, 2, ',', '.'); } /**