Skip to content

Commit 07e6263

Browse files
committed
Add format annee
1 parent 9066dd0 commit 07e6263

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export const FORMAT_ANNEE_OPTIONS = {
2+
style: "unit",
3+
unit: "year",
4+
} satisfies Intl.NumberFormatOptions;
5+
6+
export function formatAnnee(value: number, options?: Intl.NumberFormatOptions) {
7+
return value.toLocaleString("fr-FR", {
8+
...FORMAT_ANNEE_OPTIONS,
9+
...options,
10+
});
11+
}

0 commit comments

Comments
 (0)