Java BigDecimal Create getBigDecimal(Object o)

Here you can find the source of getBigDecimal(Object o)

Description

get Big Decimal

License

Open Source License

Parameter

Parameter Description
o a parameter

Declaration

public static BigDecimal getBigDecimal(Object o) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.math.BigDecimal;

public class Main {
    /**/*from w  w w.  ja va 2  s .c om*/
     * 
     * @param o
     * @return
     */
    public static BigDecimal getBigDecimal(Object o) {
        BigDecimal sh = new BigDecimal(0);
        if (null == o)
            return sh;

        if (o instanceof Number) {
            Number num = (Number) o;
            sh = new BigDecimal(num.doubleValue());
        }
        return sh;
    }
}

Related

  1. getBigDecimal(final String str, final int scale)
  2. getBigDecimal(JsonObject object, String memberName)
  3. getBigDecimal(Map map, String attr)
  4. getBigDecimal(Number number)
  5. getBigDecimal(Object number)
  6. getBigDecimal(Object o)
  7. getBigDecimal(Object v, BigDecimal defaultValue)
  8. getBigDecimal(Object value)
  9. getBigDecimal(Object value)