dinero v1.2.2 Dinero.Currency View Source

Provides functions to work with supported currencies

Link to this section Summary

Functions

Returns all supported currencies

Returns a map with the name and code of the currency or raises ArgumentError if currency is not found

Link to this section Functions

Returns all supported currencies

Example:

iex> Dinero.Currency.all()
[
  %{code: :USD, name: "United States dollar"},
  %{code: :EUR, name: "Euro"},
  %{code: :PLN, name: "Zloty"},
  %{code: :UAH, name: "Hryvnia"}
]
Link to this function

get!(currency) View Source
get!(String.t() | atom()) :: map() | ArgumentError

Returns a map with the name and code of the currency or raises ArgumentError if currency is not found

Example:

iex> Dinero.Currency.get!("USD")
%{code: :USD, name: "United States dollar"}
iex> Dinero.Currency.get!("RUR")
** (ArgumentError) currency RUR not found