Here you can find the source of getDoubleBigDecimal(String amount, int afterDot)
public static double getDoubleBigDecimal(String amount, int afterDot)
//package com.java2s; import java.math.BigDecimal; public class Main { public static double getDoubleBigDecimal(String amount, int afterDot) { double result = 0; BigDecimal bigDecimal = new BigDecimal(amount); result = bigDecimal.setScale(afterDot, BigDecimal.ROUND_HALF_EVEN).doubleValue(); return result; }//from w w w. j a v a2 s . c o m }