Java tutorial
//package com.java2s; import java.math.RoundingMode; import java.text.DecimalFormat; public class Main { public static Double toDecimal(Double value) { DecimalFormat df = new DecimalFormat("#.000000"); df.setRoundingMode(RoundingMode.DOWN); return Double.parseDouble(df.format(value)); } }