added currency formatter

This commit is contained in:
2026-06-25 11:29:08 +02:00
parent 577a927e20
commit fa3209d253
+11
View File
@@ -7,3 +7,14 @@ export function formatGermanDate(dateString: string): string {
year: 'numeric',
}).format(new Date(dateString));
}
export function formatCurrency(amount: number | null | undefined): string {
if (amount === null || amount === undefined) return 'N/A';
return new Intl.NumberFormat('de-DE', {
style: 'currency',
currency: 'EUR',
minimumFractionDigits: 0,
maximumFractionDigits: 0,
}).format(amount);
}