summaryrefslogtreecommitdiff
path: root/storefront/lib/format.js
diff options
context:
space:
mode:
authorertopogo <erwin.t.pombett@gmail.com>2026-02-01 02:49:28 +0100
committerertopogo <erwin.t.pombett@gmail.com>2026-02-01 02:49:28 +0100
commite704383cb20e7016794ccc793eda057a609be835 (patch)
treec4a909978dadd9d6315e65e588a39fedaa4d1e47 /storefront/lib/format.js
parentb034acb10960a404262602920cb07e63455f7dc3 (diff)
ajout de cart pour les commandes
Diffstat (limited to 'storefront/lib/format.js')
-rw-r--r--storefront/lib/format.js11
1 files changed, 11 insertions, 0 deletions
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)
+}