Money class

An amount of money as an integer number of minor units.

Arithmetic never uses floating point, and mixing currencies throws.

Implemented types
Annotations

Constructors

Money(int minorUnits, String currency)
const
Money.idr(int rupiah)
Indonesian rupiah; IDR has no minor digits.
const
Money.zero(String currency)
const

Properties

currency → String
final
hashCode → int
The hash code for this object.
no setteroverride
isNegative → bool
no setter
isZero → bool
no setter
minorUnits → int
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

compareTo(Money other) → int
Compares this object to another object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator +(Money other) → Money
operator -(Money other) → Money
operator <(Money other) → bool
operator <=(Money other) → bool
operator ==(Object other) → bool
The equality operator.
override
operator >(Money other) → bool
operator >=(Money other) → bool
operator unary-() → Money