Here you can find the source of isBigDecimal(String value)
Parameter | Description |
---|---|
value | The value validation is being performed on. |
public static boolean isBigDecimal(String value)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; public class Main { /**/*w w w .ja v a 2 s. co m*/ * <p>Checks if the value can safely be converted to a BigDecimal.</p> * * @param value The value validation is being performed on. * @return validation result */ public static boolean isBigDecimal(String value) { return (formatBigDecimal(value) != null); } /** * 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; } } }