Java BigDecimal Create toBig(Object o)

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

Description

to Big

License

Open Source License

Declaration

public static BigDecimal toBig(Object o) 

Method Source Code


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

import java.math.BigDecimal;

public class Main {

    public static BigDecimal toBig(Object o) {
        if (o == null || o.toString().equals("") || o.toString().equals("NaN")) {
            return new BigDecimal(0);
        }//from ww w  . j a  v a  2  s.  c  o m
        return new BigDecimal(o.toString());
    }
}

Related

  1. getDecimalValue(String value, Object franctionDigits)
  2. getDecimalValues(String[] values, String dataType)
  3. nullToBigDecimalZero(final Object obj)
  4. nullToZero(BigDecimal decimal)
  5. nullToZero(BigDecimal num)
  6. toBigDecimal(final Object o)
  7. toBigDecimal(final Object value)
  8. toBigDecimal(Object o)
  9. toBigDecimal(Object obj)