Here you can find the source of createBigDecimal(final String value)
Parameter | Description |
---|---|
value | is the string representation of the new big-decimal. |
public static BigDecimal createBigDecimal(final String value)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; import java.math.RoundingMode; public class Main { /**/*www .j a v a 2s . co m*/ * This is the scale of big-decimal literals. */ public static final int BIG_DECIMAL_SCALE = 32; /** * This method creates a new big-decimal. * * <p> * This method is used to implement big-decimal literals. * </p> * * @param value is the string representation of the new big-decimal. * @return the value as a big-decimal. */ public static BigDecimal createBigDecimal(final String value) { return createBigDecimal(new BigDecimal(value)); } /** * This method creates a new properly scaled big-decimal from an existing big-decimal. * * <p> * This method is used to implement big-decimal operators. * </p> * * @param value is big-decimal itself. * @return the value as a properly scaled big-decimal. */ public static BigDecimal createBigDecimal(final BigDecimal value) { return value.setScale(BIG_DECIMAL_SCALE, RoundingMode.HALF_EVEN); } }