ExchangeRate.fromMinorUnits constructor
ExchangeRate.fromMinorUnits(
- int exchangeRateMinorUnits, {
- required int decimalDigits,
- required CurrencyIsoCode fromCode,
- required CurrencyIsoCode toCode,
- int? toDecimalDigits,
Create an exchange rate from an integer holding minor units
to the provided number of decimalDigits
.
The toDecimalDigits
is the number of decimals of the resulting Money
amount. If not supplied the decimalDigits of the toCode
's currency
is used.
Implementation
factory ExchangeRate.fromMinorUnits(int exchangeRateMinorUnits,
{required int decimalDigits,
required CurrencyIsoCode fromCode,
required CurrencyIsoCode toCode,
int? toDecimalDigits}) =>
ExchangeRate.fromMinorUnitsWithCurrency(exchangeRateMinorUnits,
decimalDigits: decimalDigits,
fromCurrency: _findCurrency(fromCode),
toCurrency: _findCurrency(toCode),
toDecimalDigits: toDecimalDigits);