Here you can find the source of roundTo3Places(double n)
public static double roundTo3Places(double n)
//package com.java2s; //License from project: BSD License public class Main { public static double roundTo3Places(double n) { return Math.round(n * 1000d) * 0.001; }/* w ww . j a v a 2s . c om*/ }