Here you can find the source of stringToBigDecimal(String numberString)
public static BigDecimal stringToBigDecimal(String numberString)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; public class Main { public static BigDecimal stringToBigDecimal(String numberString) { BigDecimal BD;/*from w w w . jav a 2 s .c o m*/ Double number = Double.parseDouble(numberString); if (number.doubleValue() == 0.0) { BD = BigDecimal.ZERO; } else { BD = new BigDecimal(number); } return BD; } }