Here you can find the source of getScaledDouble(BigDecimal input)
public static double getScaledDouble(BigDecimal input)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; public class Main { private static final int SCALE = 2; private static final int ROUNDING_MODE = BigDecimal.ROUND_HALF_UP; public static double getScaledDouble(BigDecimal input) { double retVal = 0; if (input != null) { retVal = input.setScale(SCALE, ROUNDING_MODE).doubleValue(); }//from w w w .j a v a 2s . c o m return retVal; } }