Here you can find the source of roundTo6decimals(Double x)
private static Double roundTo6decimals(Double x)
//package com.java2s; //License from project: Apache License public class Main { private static Double roundTo6decimals(Double x) { return x == null ? null : Math.round(x * Math.pow(10, 6)) / Math.pow(10, 6); }// ww w. j ava 2 s . c o m }