Here you can find the source of isInteger(BigDecimal decimal)
public static boolean isInteger(BigDecimal decimal)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.math.RoundingMode; public class Main { public static boolean isInteger(BigDecimal decimal) { BigDecimal decimal_int = decimal.setScale(1, RoundingMode.DOWN); return decimal_int.compareTo(decimal) == 0 ? true : false; }// w ww. ja v a2s. c om }