minus
Subtracts the other decimal from this one.
Calling from Kotlin
Here's an example of calling this function from Kotlin code:
val x: Decimal = Decimal.parse("3.14")
val y: Decimal = Decimal.parse("1.5")
val result: Decimal = x - y
val expected: Decimal = Decimal.parse("1.64")
check(result == expected)Content copied to clipboard
Calling from Java
Here's an example of calling this function from Java code:
final Decimal x = Decimal.parse("3.14");
final Decimal y = Decimal.parse("1.5");
final Decimal result = x.minus(y);
final Decimal expected = Decimal.parse("1.64");
final boolean check = result.equals(expected);
if (!check) throw new IllegalStateException("Check failed.");Content copied to clipboard