View Source Cldr.Currency.Extra (ex_cldr_currencies_extra v0.7.1)
Extra utils for Cldr.Currency.
Note
Strictly speaking, this package doesn't rely on data provided by CLDR. However, it addresses issues related to
Cldr.Currency, so it uses the relevant naming convention. If CLDR provides the related data one day, there will be no need to rename.
References
ISO 3166
ISO 4217
WIKIPEDIA
Summary
Functions
Returns a list of currency codes belong to a group.
Fetches a symbol corresponding to given currency code.
Fetches a symbol corresponding to given currency code.
Fetches a territory code corresponding to a given currency code.
Fetches a territory code corresponding to a given currency code.
Types
@type currency_code() :: Cldr.Currency.code()
@type currency_group() ::
:legal_tender
| :legal_tender_extra
| :legal_tender_to_be_deprecated
| :legal_tender_deprecated
| :non_legal_tender
| :metal
| :imf
| :imf_internal
| :imf_deprecated
| :testing
| :misc
| :circulating
| :circulating_legal_tender
@type message() :: String.t()
@type symbol() :: String.t()
@type territory_code() :: Cldr.Currency.territory()
Functions
@spec currency_codes(currency_group()) :: [currency_code()]
Returns a list of currency codes belong to a group.
@spec symbol(currency_code()) :: {:ok, symbol()} | {:error, {RuntimeError, String.t()}}
Fetches a symbol corresponding to given currency code.
@spec symbol!(currency_code()) :: symbol()
Fetches a symbol corresponding to given currency code.
@spec territory_code_for_code(currency_code()) :: {:ok, territory_code()} | {:error, {Cldr.UnknownCurrencyError, message()}} | {:error, {Cldr.UnknownTerritoryError, message()}}
Fetches a territory code corresponding to a given currency code.
@spec territory_code_for_code!(currency_code()) :: territory_code()
Fetches a territory code corresponding to a given currency code.