Here you can find the source of formatBigDecimal(String value)
Parameter | Description |
---|---|
value | The value validation is being performed on. |
public static BigDecimal formatBigDecimal(String value)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; public class Main { /**// w w w .java 2 s. c o m * Checks if the value can safely be converted to a BigDecimal. * * @param value The value validation is being performed on. * @return validation result */ public static BigDecimal formatBigDecimal(String value) { if (value == null) { return null; } try { return new BigDecimal(value); } catch (NumberFormatException e) { return null; } } }