The currency (optional).
The amount value.
Adds two amounts and return results in a new one.
The other Amount to add.
A Result object containing:
Result for more information about the return type.
Deserializes an Amount from an 'array of bytes'.
The 'array of bytes' to deserialize.
The position in the 'array of bytes' to start reading from.
Result containing either an the new offset of the byte array or an Error.
Tests if two amounts are identical.
Amount to check against.
true if the amounts are identical.
Two amounts are identical if they have the same value as well as the same currency type!
Tests if two amounts are different.
Amount to check against.
true if the amounts are different.
Two amounts are different if they have the same currency type even if they have the same value!
Subtracts two amounts and return results in a new one.
Amount to subtract.
A Result object containing:
Result for more information about the return type.
Generated using TypeDoc
This module contains the 'Amount' class, which is a useful representation of a Currency value.
Remarks
The 'Amount' class provides the following methods add and subtract to perform basic arithmetic operations between amounts of the same currency.
It also provides the following comparison methods lessThan,equals and notEqual.
Best practice: Before manipulating several
Amount
objects, you should always check if they use the same Currency.Example