zero

Creates a Money based on this Currency with its amount set to zero. Example:

val usd = Currency.of("USD")
usd.zero() // USD 0.00

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 zero.


Creates a Money based on this Currency with its amount set to zero. 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 zero.

Parameters

mode

The rounding mode to configure the Rounding strategy.


Creates a Money based on this instance but with the monetary amount set to zero. Example:

val money = "USD 1.50".money()
money.zero() // USD 0.00

Receiver

Money

Return

A Money with the monetary amount set to zero.