Java tutorial
//package com.java2s; import java.math.BigDecimal; import java.math.RoundingMode; public class Main { public static int getBigDecimalInt(double value) { return BigDecimal.valueOf(value).setScale(0, RoundingMode.HALF_UP).intValue(); } }