Here you can find the source of isExact(final BigDecimal bd)
public static boolean isExact(final BigDecimal bd)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { /**/*from ww w. j av a2s. c om*/ * @return {@code true} iff the {@link BigDecimal} has scale {@code <=0} * @see <a href="http://stackoverflow.com/a/12748321">stackoverflow * discussion</a> */ public static boolean isExact(final BigDecimal bd) { return bd.signum() == 0 || bd.scale() <= 0 || bd.stripTrailingZeros().scale() <= 0; } }