ExchangeRate.fromMinorUnitsWithCurrency constructor

ExchangeRate.fromMinorUnitsWithCurrency(
  1. int exchangeRateMinorUnits, {
  2. required int decimalDigits,
  3. required Currency fromCurrency,
  4. required Currency toCurrency,
  5. int? toDecimalDigits,
})

Create an exchange rate from an integer holding minor units to the provided decimalDigits.

The decimalDigits is the number of decimalDigits of the passed exchangeRateMinorUnits.

toDecimalDigits is the number of digits to store in the toCurrency. If not supplied, the decimalDigits of the toCurrency's currency is used.

Implementation

ExchangeRate.fromMinorUnitsWithCurrency(int exchangeRateMinorUnits,
    {required int decimalDigits,
    required this.fromCurrency,
    required this.toCurrency,
    this.toDecimalDigits})
    : exchangeRate =
          Fixed.fromInt(exchangeRateMinorUnits, scale: decimalDigits);