Here you can find the source of getBigDecimalValue(Object o)
null
if the object is null
or the string representation of the object is a zero length string.
public static BigDecimal getBigDecimalValue(Object o)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010-2015 BSI Business Systems Integration AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:// w w w. j a v a 2 s.c o m * BSI Business Systems Integration AG - initial API and implementation ******************************************************************************/ import java.math.BigDecimal; public class Main { /** * Converts an object to a BigDecimal using the string representation of the object. * * @return The converted BigDecimal. Returns <code>null</code> if the object is <code>null</code> or the string * representation of the object is a zero length string. */ public static BigDecimal getBigDecimalValue(Object o) { if (o != null && o.toString().length() > 0) { return new BigDecimal(o.toString()); } else { return null; } } }