compareTo

open operator override fun compareTo(other: BigDecimal): Int

Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in value but have a different _scale (like 2.0 and 2.00) are considered equal by this method. This method is provided in preference to individual methods for each of the six boolean comparison operators (<, ==, >, >=, !=, <=). The suggested idiom for performing these comparisons is: (x.compareTo(y)<op>0), where <op> is one of the six comparison operators.

Return

-1, 0, or 1 as this BigDecimal is numerically less than, equal to, or greater than val.

Parameters

other

BigDecimal to which this BigDecimal is to be compared.