Here you can find the source of roundDouble(double iVal)
public static double roundDouble(double iVal)
//package com.java2s; //License from project: Apache License import java.text.DecimalFormat; public class Main { public static double roundDouble(double iVal) { DecimalFormat df = new DecimalFormat(".0"); String tmp = df.format(iVal); return Double.parseDouble(tmp); }/* w w w .j a v a 2 s. c o m*/ }