Cldr.Currency.currency_from_locale
You're seeing just the function
currency_from_locale
, go back to Cldr.Currency module for more information.
Returns the effective currency for a given locale
Arguments
locale
is aCldr.LanguageTag
struct returned byCldr.Locale.new!/2
Returns
- A ISO 4217 currency code as an upcased atom
Examples
iex> {:ok, locale} = Cldr.validate_locale "en", MyApp.Cldr
iex> Cldr.Currency.currency_from_locale locale
:USD
iex> {:ok, locale} = Cldr.validate_locale "en-AU", MyApp.Cldr
iex> Cldr.Currency.currency_from_locale locale
:AUD
iex> Cldr.Currency.currency_from_locale "en-GB"
:GBP
Returns the effective currency for a given locale
Arguments
locale
is any valid locale name returned byCldr.known_locale_names/1
backend
is any module that includesuse Cldr
and therefore is aCldr
backend module. The default isCldr.default_backend/0
Returns
- A ISO 4217 currency code as an upcased atom
Examples
iex> Cldr.Currency.currency_from_locale "fr-CH", MyApp.Cldr
:CHF
iex> Cldr.Currency.currency_from_locale "fr-CH-u-cu-INR", MyApp.Cldr
:INR