ExchangeRate.fromNum constructor
ExchangeRate.fromNum(
- num exchangeRate, {
- required int decimalDigits,
- required CurrencyIsoCode fromCode,
- required CurrencyIsoCode toCode,
- int? toDecimalDigits,
Create an exchange rate from an integer or decimal holding major units
The exchangeRate
is stored, rounded to decimalDigits
decimal places.
The toDecimalDigits
is the number of decimal digits
of the resulting Money amount. If not
supplied the decimalDigits of the toCode
's currency is used.
Implementation
factory ExchangeRate.fromNum(
num exchangeRate, {
required int decimalDigits,
required CurrencyIsoCode fromCode,
required CurrencyIsoCode toCode,
int? toDecimalDigits,
}) =>
ExchangeRate.fromNumWithCurrency(exchangeRate,
decimalDigits: decimalDigits,
fromCurrency: _findCurrency(fromCode),
toCurrency: _findCurrency(toCode),
toDecimalDigits: toDecimalDigits);