This commit is contained in:
8
app/utils/format.ts
Normal file
8
app/utils/format.ts
Normal file
@ -0,0 +1,8 @@
|
||||
export function formatEUR(value: number | null | undefined): string {
|
||||
if (value == null || Number.isNaN(value)) return '—';
|
||||
return new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR' }).format(value);
|
||||
}
|
||||
|
||||
export function roundMoney(n: number): number {
|
||||
return Math.round(n * 100) / 100;
|
||||
}
|
||||
Reference in New Issue
Block a user