smallestUnit

Creates a Money representing the smallest unit of value based on this Currency. Example:

val usd = Currency.of("USD")
usd.smallestUnit() // USD 0.01

Calculations using it are rounded using a Rounding strategy configured with RoundingMode.HALF_EVEN.

Receiver

Currency

Return

A Money with the monetary amount set to the smallest unit of value based on this Currency.


Creates a Money representing the smallest unit of value based on this Currency. Calculations using it are rounded using a Rounding strategy configured with the specified mode.

Receiver

Currency

Return

A Money with the monetary amount set to the smallest unit of value based on this Currency.

Parameters

mode

The rounding mode to configure the Rounding strategy.


Creates a Money based on this instance but with the monetary amount set to the smallest unit of the currency. Example:

val money = "USD 1.50".money()
money.smallestUnit() // USD 0.01

The returned Money is always positive.

Receiver

Money

Return

A Money with the monetary amount set to the smallest unit.