Java tutorial
//package com.java2s; import java.math.BigDecimal; public class Main { public static final int NUM_AFTER_COM = 3; public static int convertToInteger(String data) { BigDecimal num = new BigDecimal(data).setScale(NUM_AFTER_COM, BigDecimal.ROUND_HALF_UP); String res = num.toString().replace(".", ""); return Integer.valueOf(res); } }