Skip to content
Snippets Groups Projects
Commit 2449740a authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Use compact currency formatter to display numbers in Y axis

parent 61a6c2cb
No related branches found
No related tags found
1 merge request!90Carte budget etat
Pipeline #7240 passed
...@@ -11,6 +11,13 @@ ...@@ -11,6 +11,13 @@
export let budgetSimulation: BudgetSimulation 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", { const euroAmountFormatter = new Intl.NumberFormat("fr-FR", {
currency: "EUR", currency: "EUR",
maximumFractionDigits: 0, maximumFractionDigits: 0,
...@@ -108,7 +115,9 @@ ...@@ -108,7 +115,9 @@
y="assiette_csg_abattue_sum" y="assiette_csg_abattue_sum"
> >
<Svg> <Svg>
<AxisY /> <AxisY
formatTick={(value) => euroAmountCompactFormatter.format(value)}
/>
<Column /> <Column />
<Column <Column
fill="red" fill="red"
......
...@@ -11,6 +11,13 @@ ...@@ -11,6 +11,13 @@
export let budgetSimulation: BudgetSimulation 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", { const euroAmountFormatter = new Intl.NumberFormat("fr-FR", {
currency: "EUR", currency: "EUR",
maximumFractionDigits: 0, maximumFractionDigits: 0,
...@@ -100,7 +107,9 @@ ...@@ -100,7 +107,9 @@
y="rfr_sum" y="rfr_sum"
> >
<Svg> <Svg>
<AxisY /> <AxisY
formatTick={(value) => euroAmountCompactFormatter.format(value)}
/>
<Column /> <Column />
<Column <Column
fill="red" fill="red"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment