MyApp.Cldr.Territory.to_currency_code
You're seeing just the function
to_currency_code
, go back to MyApp.Cldr.Territory module for more information.
Specs
to_currency_code(Cldr.Territory.atom_binary_tag(), Cldr.Territory.as_options()) :: {:ok, Cldr.Territory.atom_binary_charlist()} | {:error, Cldr.Territory.error()}
A helper method to get a territory's currency code
if a territory has multiply currencies then the oldest active currency is returned.
Returns {:ok, code}
if successful, otherwise {:error, reason}
.
options
are:as: :atom
as: :binary
as: :charlist
Example
iex> MyApp.Cldr.Territory.to_currency_code(:US)
{:ok, :USD}
iex> MyApp.Cldr.Territory.to_currency_code("cu")
{:ok, :CUP}