9 lines
312 B
TypeScript
9 lines
312 B
TypeScript
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;
|
|
}
|