Here you can find the source of parseBigDecimal(Object value)
public static final BigDecimal parseBigDecimal(Object value)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; public class Main { public static final BigDecimal parseBigDecimal(Object value) { String str;/*w w w .j a va2s .c om*/ if (value == null) return BigDecimal.valueOf(0L); if (value instanceof BigDecimal) return ((BigDecimal) value); if (value instanceof Number) return BigDecimal.valueOf(((Number) value).longValue()); if (value instanceof Boolean) return BigDecimal.valueOf((((Boolean) value).booleanValue()) ? 1L : 0L); if ((str = value.toString()).equals("")) return BigDecimal.valueOf(0L); return new BigDecimal(str); } }