Here you can find the source of round(double value)
public static double round(double value)
//package com.java2s; //License from project: Open Source License public class Main { public static double round(double value) { final double NUMBER_OF_DIGITS = 1E5; return (double) Math.round(value * NUMBER_OF_DIGITS) / NUMBER_OF_DIGITS; }//from w ww . ja v a 2 s . c o m }