SoftBank.Cldr.Currency.currency_for_code
You're seeing just the function
currency_for_code
, go back to SoftBank.Cldr.Currency module for more information.
Link to this function
currency_for_code(currency_code, options \\ [locale: SoftBank.Cldr.default_locale()])
View SourceSpecs
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 abinary
oratom
representation of an ISO 4217 currency code.
Examples
iex> SoftBank.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> SoftBank.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
}}