Java bigdecimal class intValue() method transforms bigdecimal
value in to integer type values.
Method throws NumberFormatException if it finds value other than a integer or double.
In the example four bigdecimal
objects namely: obj_0, obj_1, obj_2 & obj_3 respectively have been created. Except the first object rest all objects are assigned positive decimal values with java.lang.Math class fields and methods.
In the example along with method generated result, original bigdecimal value is also shown.
Syntax for using the method: public int intValue()
int i = (this.object).intValue();
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.