Here you can find the source of isNullOrZero(BigDecimal number)
Parameter | Description |
---|---|
number | a parameter |
public static boolean isNullOrZero(BigDecimal number)
//package com.java2s; import java.math.BigDecimal; public class Main { /**// ww w.j a va2 s . co m * Utility function to check if the BigDecimal value is null or zero. * Currently being called from Util.formatMoney function above. * @param number * @return If number is null or zero returns true, else returns false. */ public static boolean isNullOrZero(BigDecimal number) { boolean isBigDecimalValueNullOrZero = false; if (number == null) isBigDecimalValueNullOrZero = true; else if (number != null && number.compareTo(BigDecimal.ZERO) == 0) isBigDecimalValueNullOrZero = true; return isBigDecimalValueNullOrZero; } }