ExchangeRate.fromBigInt constructor

ExchangeRate.fromBigInt(
  1. BigInt exchangeRateMinorUnits, {
  2. required int decimalDigits,
  3. required CurrencyIsoCode fromIsoCode,
  4. required CurrencyIsoCode toIsoCode,
})

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

The amount is stored with decimalDigits decimal places.

The decimalDigits is the number of decimal Digits of the resulting Money amount. If not supplied the decimalDigits of the toIsoCode's currency is used.

Implementation

factory ExchangeRate.fromBigInt(BigInt exchangeRateMinorUnits,
        {required int decimalDigits,
        required CurrencyIsoCode fromIsoCode,
        required CurrencyIsoCode toIsoCode}) =>
    ExchangeRate.fromBigIntWithCurrency(exchangeRateMinorUnits,
        decimalDigits: decimalDigits,
        fromCurrency: _findCurrency(fromIsoCode),
        toCurrency: _findCurrency(toIsoCode));