MyApp.Cldr.Currency.currency_from_locale
You're seeing just the function
currency_from_locale
, go back to MyApp.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} = MyApp.Cldr.validate_locale "en"
iex> MyApp.Cldr.Currency.currency_from_locale locale
:USD
iex> {:ok, locale} = MyApp.Cldr.validate_locale "en-AU"
iex> MyApp.Cldr.Currency.currency_from_locale locale
:AUD
iex> MyApp.Cldr.Currency.currency_from_locale "en-GB"
:GBP