fix purchases.php

This commit is contained in:
Francesco Picone
2025-12-06 17:28:26 +01:00
parent 6ecbeee404
commit c5019dfbda

View File

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