formatPrice
UtilFormats 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-priceInstallation
1 · Add registry to components.json
2 · Install component
Examples
Currency formatter
Switch between currencies to see formatted output.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
amountreq | number | — | The numeric amount to format. |
currency | string | "ZAR" | ISO 4217 currency code. |
locale | string | — | BCP 47 locale string. Defaults to the system locale. |
symbolDisplay | "narrowSymbol" | "symbol" | "code" | "narrowSymbol" | How the currency symbol is rendered. |