Java BigDecimal extractBigDecimal(String value)

Here you can find the source of extractBigDecimal(String value)

Description

Extract a BigDecimal instance.

License

Open Source License

Parameter

Parameter Description
value The value to parse as a BigDecimal.

Exception

Parameter Description
NumberFormatException If <tt>value</tt> is not a valid decimalnumber.

Return

The value as a BigDecimal, or null if value is null.

Declaration

public static BigDecimal extractBigDecimal(String value) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.math.BigDecimal;

public class Main {
    /**/*  w w w.j a  v  a 2s  .  c o  m*/
     * Extract a {@link BigDecimal} instance. If <tt>value</tt> is
     * <tt>null</tt>, then <tt>null</tt> will be returned.
     * @param value The value to parse as a BigDecimal.
     * @return The value as a BigDecimal, or <tt>null</tt> if <tt>value</tt>
     * is <tt>null</tt>.
     * @throws NumberFormatException If <tt>value</tt> is not a valid decimal
     * number.
     * @see BigDecimal#BigDecimal(String)
     */
    public static BigDecimal extractBigDecimal(String value) {
        if (value != null) {
            return new BigDecimal(value);
        } else {
            return null;
        }
    }
}

Related

  1. deserializeBigDecimalFromString(String decimal)
  2. exp(BigDecimal power)
  3. exp(BigDecimal x, int scale)
  4. exponentialFormatBigDecimal(BigDecimal bd)
  5. expTaylor(BigDecimal x, int scale)
  6. firstNonZero(final BigDecimal... values)
  7. floatValue(BigDecimal val)
  8. fromLongToBigDecimal(long longValue)
  9. getArcCosineFor(BigDecimal radians)