Money.fromIntWithCurrency constructor

Money.fromIntWithCurrency(
  1. int minorUnits,
  2. Currency currency, {
  3. int? decimalDigits,
})

Creates an instance of Money from an integer.

minorUnits - the no. minorUnits of the currency, e.g (cents).

Implementation

factory Money.fromIntWithCurrency(int minorUnits, Currency currency,
        {int? decimalDigits}) =>
    Money._from(
        Fixed.fromInt(minorUnits,
            scale: decimalDigits ?? currency.decimalDigits),
        currency);