Here you can find the source of numberToBigDecimal(Object number)
public static BigDecimal numberToBigDecimal(Object number)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; public class Main { public static BigDecimal numberToBigDecimal(Object number) { if (number == null) { return null; }//from ww w . j a v a 2 s . c o m if (!(number instanceof Number)) { throw new IllegalArgumentException("Input object is not a number"); } return new BigDecimal(((Number) number).toString()); } }