data class Amount : Comparable<Amount>
Amount represents a positive quantity of currency, measured in pennies, which are the smallest representable units.
Note that "pennies" are not necessarily 1/100ths of a currency unit, but are the actual smallest amount used in whatever currency the amount represents.
Amounts of different currencies
TODO: It may make sense to replace this with convenience extensions over the JSR 354 MonetaryAmount interface TODO: Should amount be abstracted to cover things like quantities of a stock, bond, commercial paper etc? Probably. TODO: Think about how positive-only vs positive-or-negative amounts can be represented in the type system.
<init> |
Amount(pennies: Long, currency: Currency) Amount represents a positive quantity of currency, measured in pennies, which are the smallest representable units. |
currency |
val currency: Currency |
pennies |
val pennies: Long |
compareTo |
fun compareTo(other: Amount): Int |
div |
operator fun div(other: Long): Amount operator fun div(other: Int): Amount |
minus |
operator fun minus(other: Amount): Amount |
plus |
operator fun plus(other: Amount): Amount |
times |
operator fun times(other: Long): Amount operator fun times(other: Int): Amount |
toString |
fun toString(): String |