Rechnungsbeträge deutsch formatieren

This commit is contained in:
2026-07-20 10:17:00 +02:00
parent ae379b0f22
commit 720c70845e
4 changed files with 27 additions and 10 deletions

View File

@@ -447,7 +447,10 @@ async function getCloseData(server:FastifyInstance,item: any, tenant: any, units
// Formatiert Zahlen zu deutscher Währung
function renderCurrency(value: any, currency = "€") {
if (value === undefined || value === null) return "0,00 " + currency;
return Number(value).toFixed(2).replace(".", ",") + " " + currency;
return Number(value).toLocaleString("de-DE", {
minimumFractionDigits: 2,
maximumFractionDigits: 2
}) + " " + currency;
}
// Berechnet den Zeilenpreis (Menge * Preis * Rabatt)