Here you can find the source of extractBigDecimal(String value)
Parameter | Description |
---|---|
value | The value to parse as a BigDecimal. |
Parameter | Description |
---|---|
NumberFormatException | If <tt>value</tt> is not a valid decimalnumber. |
public static BigDecimal extractBigDecimal(String value)
//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; } } }