View Source Cldr.Currency.Extra (ex_cldr_currencies_extra v0.2.0)

Extra utils for Cldr.Currency.

Note

Strictly speaking, this package doesn't based on 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

Summary

Functions

Returns a list of currency codes belong to a group.

Fetches a territory code corresponding to a given currency code.

Fetchs 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_deprecated
  | :non_legal_tender
  | :metal
  | :imf
  | :imf_internal
  | :imf_deprecated
  | :testing
  | :misc
  | :international
@type message() :: String.t()
@type territory_code() :: Cldr.Currency.territory()

Functions

Link to this function

currency_codes(currency_group)

View Source
@spec currency_codes(currency_group()) :: [currency_code()]

Returns a list of currency codes belong to a group.

Link to this function

territory_code_for_code(currency_code)

View Source
@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.

Link to this function

territory_code_for_code!(currency_code)

View Source
@spec territory_code_for_code!(currency_code()) :: territory_code()

Fetchs a territory code corresponding to a given currency code.