How to check if BigDecimal variable == 0 in java?

后端 未结 11 600
灰色年华
灰色年华 2020-12-04 06:29

I have the following code in Java;

BigDecimal price; // assigned elsewhere

if (price.compareTo(new BigDecimal(\"0.00\")) == 0) {
    return true;
}
<         


        
11条回答
提交回复
热议问题