Here you can find the source of convertToBigDecimal(String val)
public static BigDecimal convertToBigDecimal(String val) throws NumberFormatException
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { public static BigDecimal convertToBigDecimal(String val) throws NumberFormatException { BigDecimal returnValue = new BigDecimal(0.00); if (val == null || val.trim().equals("")) { return returnValue; }/*from w w w .j a v a 2 s . c o m*/ val = val.replace(",", ""); val = val.replace("$", ""); returnValue = new BigDecimal(val.trim()); return returnValue; } }