MCPcopy Create free account
hub / github.com/formatjs/formatjs / defaultCurrency

Function defaultCurrency

packages/utils/defaultCurrency.ts:20–25  ·  view source on GitHub ↗
(countryCode?: string)

Source from the content-addressed store, hash-verified

18 * @returns default currency code, or USD if not found
19 */
20export function defaultCurrency(countryCode?: string): string {
21 countryCode = canonicalizeCountryCode(countryCode)
22 return (
23 (countryCode && countryCode in data && data[countryCode as 'US']) || 'USD'
24 )
25}
26
27/**
28 * Look up countries using a default currency.

Callers 1

Calls 1

canonicalizeCountryCodeFunction · 0.85

Tested by

no test coverage detected