Here you can find the source of getDecimal(String number, BigDecimal def)
public static BigDecimal getDecimal(String number, BigDecimal def)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; public class Main { /**//from w w w . j a v a 2 s . c o m * Parse the given string into a big decimal if possible otherwise return * the specified default. */ public static BigDecimal getDecimal(String number, BigDecimal def) { try { return new BigDecimal(number); } catch (Exception e) { return def; } } }