dinero v1.1.1 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
Link to this function
all()
View Source
all()
View Source
all() :: list()
all() :: list()
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
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