Java tutorial
//package com.java2s; import java.math.BigDecimal; public class Main { public static String keepZeroSecimal(String numberStr) { double number = Double.parseDouble(numberStr); BigDecimal b = new BigDecimal(number); String ss = b.setScale(0, BigDecimal.ROUND_HALF_UP).doubleValue() + ""; return ss; } }