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.
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.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;
|
Ads