Example below demonstrates working of bigdecimal
class unscaledValue method. Method returns biginteger
values. An un scaled value of the bigdecimal object is returned as
biginteger object value.
Method generates NumberFormatException, if it finds
the bigdecimal value other than integers and double
types values.
Syntax for using the method: public BigInteger
unscaledValue()
Suppose we have bigdecimal objects x & biginteger object y;
then y = x.unscaledValue();
System.out.println(y);
Java_bigdecimal_unscaledValue.java
import java.math.BigDecimal;
|
|
Recommend the tutorial |
Ask Questions? Discuss: Java bigdecimal unscaledValue example
Post your Comment