Here you can find the source of roundDouble(double d)
public static double roundDouble(double d)
//package com.java2s; public class Main { public static double roundDouble(double d) { int c = 10; int temp = (int) ((d * Math.pow(10, c))); return (((double) temp) / Math.pow(10, c)); }// w w w .j a v a 2 s .c o m }