Skip to content
Snippets Groups Projects
Commit b4d7bec9 authored by Toufic Batache's avatar Toufic Batache
Browse files

Fixes #201 : montrer "moins de X%" lorsqu'un pourcentage est inférieur à 1%

parent c703ff9e
Branches
Tags
1 merge request!251Amélioration de l'affichage des petits montants budgétaires
Pipeline #16005 passed
...@@ -25,7 +25,9 @@ export function valueFormatter( ...@@ -25,7 +25,9 @@ export function valueFormatter(
: typeof baseValue === "number" : typeof baseValue === "number"
? unit?.ratio // rate ? unit?.ratio // rate
? (value: unknown): string => ? (value: unknown): string =>
new Intl.NumberFormat("fr-FR", { Math.abs(value as number) < 0.01
? "moins de 1%"
: new Intl.NumberFormat("fr-FR", {
maximumFractionDigits: 2, maximumFractionDigits: 2,
minimumFractionDigits: 0, minimumFractionDigits: 0,
style: "percent", style: "percent",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment