formatPrice

Util

Formats a numeric amount as a localised currency string using Intl.NumberFormat. Defaults to ZAR with the narrow symbol. Used by StayCard and ProductCard internally.

core/format-price

Installation

1 · Add registry to components.json

2 · Install component

Examples

Currency formatter

Switch between currencies to see formatted output.

API Reference

PropTypeDescription
amountreq
numberThe numeric amount to format.
currency
stringISO 4217 currency code.
locale
stringBCP 47 locale string. Defaults to the system locale.
symbolDisplay
"narrowSymbol" | "symbol" | "code"How the currency symbol is rendered.