MyApp.Cldr.Currency.currency_for_code

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

currency_for_code(currency_code, options \\ [locale: MyApp.Cldr.default_locale()])

View Source

Specs

currency_for_code(Cldr.Currency.code(), Keyword.t()) ::
  {:ok, Cldr.Currency.t()} | {:error, {module(), String.t()}}

Returns the currency metadata for the requested currency code.

Arguments

  • currency_code is a binary or atom representation of an ISO 4217 currency code.

Examples

iex> MyApp.Cldr.Currency.currency_for_code("AUD")
{:ok,
  %Cldr.Currency{
    cash_digits: 2,
    cash_rounding: 0,
    code: "AUD",
    count: %{one: "Australian dollar", other: "Australian dollars"},
    digits: 2,
    iso_digits: 2,
    name: "Australian Dollar",
    narrow_symbol: "$",
    rounding: 0,
    symbol: "A$",
    tender: true
}}

iex> MyApp.Cldr.Currency.currency_for_code("THB")
{:ok,
  %Cldr.Currency{
    cash_digits: 2,
    cash_rounding: 0,
    code: "THB",
    count: %{one: "Thai baht", other: "Thai baht"},
    digits: 2,
    iso_digits: 2,
    name: "Thai Baht",
    narrow_symbol: "฿",
    rounding: 0,
    symbol: "THB",
    tender: true
}}