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.
Link to this function

to_currency_code(territory_code, opts \\ [as: :atom])

View Source

Specs

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}