Here you can find the source of bigDecimal(Object object)
public static BigDecimal bigDecimal(Object object)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { public static BigDecimal bigDecimal(Object object) { if (object == null) { throw new NullPointerException(); }//w ww. j av a2 s .c o m BigDecimal result; try { result = new BigDecimal(String.valueOf(object).replaceAll(",", "")); } catch (NumberFormatException e) { throw new NumberFormatException("Please give me a numeral.Not " + object); } return result; } }