Here you can find the source of roundDouble(double pDouble, int pPlaces)
public static final double roundDouble(double pDouble, int pPlaces)
//package com.java2s; //License from project: Open Source License public class Main { public static final double roundDouble(double pDouble, int pPlaces) { return Math.round(pDouble * Math.pow(10, (double) pPlaces)) / Math.pow(10, (double) pPlaces); }/* w ww. j a v a 2 s . c o m*/ }