Java bigdecimal class floatValue() method translates bigdecimal value in to float type value. Method throws NumberFormatException if it finds value other than a integer or float. In the example four bigdecimal objects namely: weisz_0, weisz_1, weisz_2 & weisz_3 respectively have been created.
In the example along with method generated result, original bigdecimal value is also shown.
Syntax for using the method: public float floatValue()
System.out.println(bigdecimal_objectName.floatValue());
or
BigDecimal x = this.object.floatValue();
Java_BigDecimal_float.java
import java.math.BigDecimal;
|
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.
Ask Questions? Discuss: Java BigDecimal floatValue method example
Post your Comment