Money.float constructor

Money.float(
  1. double amount,
  2. Currency currency
)

Converts double to integer which represents amount of the instance in the smallest unit of the currency

Use it if your money information is given as a float and you need to do some operations with it

Implementation

factory Money.float(double amount, Currency currency) =>
    Money((amount * pow(10, currency.digits)).floor(), currency);