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, ',', '.'); } /**