Java BigDecimal textToBigDecimal(String amountAsText)

Here you can find the source of textToBigDecimal(String amountAsText)

Description

text To Big Decimal

License

Open Source License

Declaration

public static BigDecimal textToBigDecimal(String amountAsText) 

Method Source Code


//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*/
}

Related

  1. stripTrailingZeros(final BigDecimal decimal)
  2. strToBigDecimal(final String arg)
  3. strValueBigDecimal(Number number)
  4. tangent(BigDecimal x)
  5. tanto(BigDecimal r, BigDecimal n)
  6. transferDonateAmount2Point(BigDecimal donateAmount)
  7. tryParseBigDecimal(Object val, BigDecimal defaultVal)
  8. tryToStoreAsIntegerBigDecimal(Object ob)
  9. tryToStoreAsRealBigDecimal(Object ob)