Java tutorial
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; public class Main { public static int convertsToInt(double v) { BigDecimal b = new BigDecimal(v); return b.intValue(); } }