diff --git a/src/lib/components/CsgBudgetView.svelte b/src/lib/components/CsgBudgetView.svelte index a5f5cbe21713c7d98a206fe118c9b8bc4d1e1c1e..e93db9f2c593de7d871a3ae3d26c74d5a50bdd95 100644 --- a/src/lib/components/CsgBudgetView.svelte +++ b/src/lib/components/CsgBudgetView.svelte @@ -11,6 +11,13 @@ export let budgetSimulation: BudgetSimulation + const euroAmountCompactFormatter = new Intl.NumberFormat("fr-FR", { + currency: "EUR", + maximumFractionDigits: 2, + minimumFractionDigits: 0, + notation: "compact", // Example: 3,2 Md € + style: "currency", + }) const euroAmountFormatter = new Intl.NumberFormat("fr-FR", { currency: "EUR", maximumFractionDigits: 0, @@ -108,7 +115,9 @@ y="assiette_csg_abattue_sum" > <Svg> - <AxisY /> + <AxisY + formatTick={(value) => euroAmountCompactFormatter.format(value)} + /> <Column /> <Column fill="red" diff --git a/src/lib/components/IrBudgetView.svelte b/src/lib/components/IrBudgetView.svelte index 25dd0768e48f7f3c8120e5117b4826d83d5f0dd8..eb68367a58609385cd996d3aa5ef30fb8e0d5d5c 100644 --- a/src/lib/components/IrBudgetView.svelte +++ b/src/lib/components/IrBudgetView.svelte @@ -11,6 +11,13 @@ export let budgetSimulation: BudgetSimulation + const euroAmountCompactFormatter = new Intl.NumberFormat("fr-FR", { + currency: "EUR", + maximumFractionDigits: 2, + minimumFractionDigits: 0, + notation: "compact", // Example: 3,2 Md € + style: "currency", + }) const euroAmountFormatter = new Intl.NumberFormat("fr-FR", { currency: "EUR", maximumFractionDigits: 0, @@ -100,7 +107,9 @@ y="rfr_sum" > <Svg> - <AxisY /> + <AxisY + formatTick={(value) => euroAmountCompactFormatter.format(value)} + /> <Column /> <Column fill="red"