BigDecimal equals Zero - Java java.math

Java examples for java.math:BigDecimal Compare

Description

BigDecimal equals Zero

Demo Code


//package com.java2s;
import java.math.BigDecimal;

public class Main {
    public static void main(String[] argv) throws Exception {
        BigDecimal that = new BigDecimal("1234");
        System.out.println(eqZero(that));
    }/*from  ww  w  .  j a v  a2  s.  c  o m*/

    public static boolean eqZero(final BigDecimal that) {
        return BigDecimal.ZERO.compareTo(that) == 0;
    }
}

Related Tutorials