CurrencyAmounts.Currency
— TypeCurrency type, e.g. EUR, USD.
CurrencyAmounts.CurrencyAmount
— TypeCurrencyAmount(x:: Number, c:: Currency)
Amount of a specific currency, i.e. a combination of a numeric value and a currency type.
Examples:
CurrencyAmount(100.5, EUR) # assumes `@currencies EUR` has been called before
100.5EUR # equivalent constructor
CurrencyAmounts.ExchangeRate
— TypeExchangeRate(x:: Number, ::BaseCurrency, ::QuoteCurrency)
Exchange rate between two currencies.
Base.convert
— Methodconvert(targetcurrency:: Currency, amount:: CurrencyAmount, exchangerate_iterable):: CurrencyAmount
Converts the amountto target currency using one of the given rates in the
exchangerateiterable. If a conversion is not possible using one of the exchange rate,
missing` is returned.
Base.convert
— Methodconvert(targetcurrency:: Currency, amount:: CurrencyAmount, exchangerate:: ExchangeRate):: CurrencyAmount
Converts the amountto target currency using the given
exchange_rate. If a conversion is not possible using this exchange rate,
missing` is returned.
CurrencyAmounts.@currencies
— Macro@currencies(syms)
Creates one or more currency definitions, these are global constants of type Currency{T}
.
Example:
@currencies EUR, USD, GBP
@currencies EUR
the latter is equivalent to
const EUR = Currency(:EUR)