Cldr.Currency.known_currency_code

You're seeing just the function known_currency_code, go back to Cldr.Currency module for more information.
Link to this function

known_currency_code(currency_code)

View Source

Specs

known_currency_code(code()) :: {:ok, code()} | {:error, {module(), String.t()}}

Returns a 2-tuple indicating if the supplied currency code is known.

Arguments

  • currency_code is a binary or atom representing an ISO4217 currency code

Returns

  • {:ok, currency_code} or

  • {:error, {exception, reason}}

Examples

iex> Cldr.Currency.known_currency_code "AUD"
{:ok, :AUD}

iex> Cldr.Currency.known_currency_code "GGG"
{:error, {Cldr.UnknownCurrencyError, "The currency \"GGG\" is invalid"}}