Java BigDecimal to toSimpleBigDecimal(Object num)

Here you can find the source of toSimpleBigDecimal(Object num)

Description

to Simple Big Decimal

License

Open Source License

Declaration

public static BigDecimal toSimpleBigDecimal(Object num) 

Method Source Code


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

import java.math.BigDecimal;

public class Main {
    public static BigDecimal toSimpleBigDecimal(Object num) {
        try {/*from   w  w  w . java2  s  . com*/
            return num != null ? new BigDecimal(num.toString()) : null;
        } catch (Exception ignored) {
        }
        return null;
    }
}

Related

  1. toLongObject(@Nullable final BigDecimal value)
  2. toNumber(final BigDecimal bigDecimal, final Class clazz)
  3. toObject(BigDecimal value)
  4. toPercent(final BigDecimal decimalValue, final MathContext mathCntext)
  5. toScientificNotation(BigDecimal bd)
  6. toString(BigDecimal num)
  7. toString(BigDecimal value, int numberDecimalPlaces)
  8. toString(final BigDecimal dec)
  9. toUnsignedString(BigDecimal bigDecimal, int shift)