Here you can find the source of toBigDecimal(String value)
public static BigDecimal toBigDecimal(String value)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; public class Main { public static BigDecimal toBigDecimal(String value) { if (isNumber(value)) { return new BigDecimal(value); }// w ww . j av a 2 s . c o m return null; } public static boolean isNumber(String numStr) { try { if (numStr == null || numStr.trim().equals("")) return false; new BigDecimal(numStr); return true; } catch (NumberFormatException e) { return false; } } }