Format money for display.
The amount is read with fromCents, so it follows the same ISO 4217 rules: every CurrencyCode has two decimals, and an untyped caller's jpy shows 1000 as ¥1,000.
fromCents
CurrencyCode
jpy
1000
¥1,000
Amount in the currency's smallest unit
Currency code (default: usd)
Locale for formatting (default: en-US)
Formatted currency string
When currency is not a string, or is empty or only whitespace
currency
formatMoney(1050); // "$10.50"formatMoney(1050, 'gbp', 'en-GB'); // "£10.50" Copy
formatMoney(1050); // "$10.50"formatMoney(1050, 'gbp', 'en-GB'); // "£10.50"
Format money for display.
The amount is read with
fromCents, so it follows the same ISO 4217 rules: everyCurrencyCodehas two decimals, and an untyped caller'sjpyshows1000as¥1,000.