Here you can find the source of textToBigDecimal(String amountAsText)
public static BigDecimal textToBigDecimal(String amountAsText)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.math.RoundingMode; public class Main { public static final int DECIMAL_SCALE = 8; public static final RoundingMode ROUNDING_MODE = RoundingMode.HALF_UP; public static BigDecimal textToBigDecimal(String amountAsText) { return new BigDecimal(amountAsText).setScale(DECIMAL_SCALE, ROUNDING_MODE); }/*from w ww . ja v a 2s .co m*/ }