Money.from
The Money class allows you to create a Money instance from a variety of other types:
Money.fromFixed
Money.fromInt
Money.fromBigInt
Money.fromNum
Money.fromDecimal
Each of the variants have a withCurrency
alternate form:
Money.fromFixedWithCurrency
Money.fromIntWithCurrency
Money.fromBigIntWithCurrency
Money.fromNumWithCurrency
Money.fromDecimalWithCurrency
The recommended method is to used Money.fromFixed or the `withCurrency` alternative. Using `fromFixed` then allows you to store and transmit your Money amounts without loss of precision.
Money
can be instantiated by providing the amount in the minor units of the currency (e.g. cents):
Last updated