How to use comparison operators like >, =, < on BigDecimal

后端 未结 8 1190
清酒与你
清酒与你 2021-01-30 11:54

I have a domain class with unitPrice set as BigDecimal data type. Now I am trying to create a method to compare price but it seems like I can\'t have comparison operators in Big

8条回答
  •  醉话见心
    2021-01-30 12:45

    Using com.ibm.etools.marshall.util.BigDecimalRange util class of IBM one can compare if BigDecimal in range.

    boolean isCalculatedSumInRange = BigDecimalRange.isInRange(low, high, calculatedSum);
    

提交回复
热议问题