Java tutorial
//package com.java2s; import java.math.BigDecimal; public class Main { public static double getBigDecimal_6(String strings) { double price = Double.parseDouble(strings); BigDecimal bg = new BigDecimal(price).setScale(6, BigDecimal.ROUND_UP); return bg.doubleValue(); } }