Frontend | Backend | Api

Money (Backend)

Money objects are immutable. Arithmetic methods return a new instance with the result, handle rounding and ensure currencies match.

Method Description Returns
getCurrency() Get the currency Currency
getCurrencyCode() Get the currency code string
getValue() Get the value string
isEqual() Is the given money object equal? bool
isGreaterThan() Compares the current Money object with the given Money object. Will return true if the current Money object is greater than the given Money object. bool
isGreaterThanOrEqual() Compares the current Money object with the given Money object. Will return true if the current Money object is greater than or equal to the given Money object. bool
isLessThan() Compares the current Money object with the given Money object. Will return true if the current Money object is less than the given Money object. bool
isLessThanOrEqual() Compares the current Money object with the given Money object. Will return true if the current Money object is less than or equal to the given Money object. bool
isZero() Is the money object zero? bool
isPositive() Is the money object positive? (ie Greater than zero) bool
isNegative() Is the money object negative? (ie Less than zero) bool