Here you can find the source of string2BigDecimal(String valor)
public static BigDecimal string2BigDecimal(String valor) throws ParseException
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.ParseException; import java.util.Locale; public class Main { public static BigDecimal string2BigDecimal(String valor) throws ParseException { BigDecimal valorBig = BigDecimal.ZERO; Locale brasil = new Locale("pt", "BR"); DecimalFormat df = new DecimalFormat("#,##0.00", new DecimalFormatSymbols(brasil)); df.setParseBigDecimal(true);//w ww . j a v a2 s. com valorBig = (BigDecimal) df.parse(valor); return valorBig; } }