Java BigDecimal Create getBigDecimal(Object o)

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

Description

get Big Decimal

License

Open Source License

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 {
    public static BigDecimal getBigDecimal(Object o) {

        if (o instanceof Number) {
            return new BigDecimal(((Number) o).doubleValue());
        }//from   www  . j  a  va 2 s. c  o m

        return new BigDecimal(o.toString());

    }
}

Related

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