ExchangeRate.fromNumWithCurrency constructor
ExchangeRate.fromNumWithCurrency(})
Create an exchange rate from an integer or decimal holding major units
The amount is stored, rounded to decimalDigits
decimal places.
The decimalDigits
is the number of decimals of the resulting
Money amount. If not supplied the decimalDigits of the toCurrency's
is
Implementation
ExchangeRate.fromNumWithCurrency(
num rateAsNum, {
required int decimalDigits,
required this.fromCurrency,
required this.toCurrency,
this.toDecimalDigits,
}) {
exchangeRate = Fixed.fromNum(rateAsNum, scale: decimalDigits);
}