From e704383cb20e7016794ccc793eda057a609be835 Mon Sep 17 00:00:00 2001 From: ertopogo Date: Sun, 1 Feb 2026 02:49:28 +0100 Subject: ajout de cart pour les commandes --- storefront/lib/format.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 storefront/lib/format.js (limited to 'storefront/lib/format.js') diff --git a/storefront/lib/format.js b/storefront/lib/format.js new file mode 100644 index 0000000..2f44c2e --- /dev/null +++ b/storefront/lib/format.js @@ -0,0 +1,11 @@ +export const formatAmount = (amount, currencyCode = "EUR") => { + if (typeof amount !== "number") { + return "" + } + + const normalizedCurrency = currencyCode.toUpperCase() + return new Intl.NumberFormat("fr-FR", { + style: "currency", + currency: normalizedCurrency, + }).format(amount / 100) +} -- cgit v1.2.3