From eb1bb8aeec419ee518ed0ca93fac1c736c74573d Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Thu, 12 Mar 2026 09:23:46 +0100 Subject: [PATCH] feat(04-01): add locale parameter to formatCurrency, default 'en' - Replace hardcoded 'de-DE' with optional locale parameter defaulting to 'en' - Defensive locale || 'en' guard prevents RangeError on empty string - All existing call sites get English formatting (FIX-01) - Third arg enables locale-aware chart tooltips in follow-on plans --- frontend/src/lib/format.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/format.ts b/frontend/src/lib/format.ts index 4c5ecf7..90592be 100644 --- a/frontend/src/lib/format.ts +++ b/frontend/src/lib/format.ts @@ -1,5 +1,9 @@ -export function formatCurrency(amount: number, currency: string = 'EUR'): string { - return new Intl.NumberFormat('de-DE', { +export function formatCurrency( + amount: number, + currency: string = 'EUR', + locale: string = 'en' +): string { + return new Intl.NumberFormat(locale || 'en', { style: 'currency', currency, }).format(amount)