73
Java BigDecimal floatValue() method
The floatValue() method of java BigDecimal class is used to Convert this BigDecimal to a float value. when the return value is finite, this conversion can lose information about the precision of the BigDecimal value.
Syntax:
Parameter:
No
Exception:
No
Returns:
It returns float value after conversion from BigDecimal.
Example 1
Output:
Returned float value is : 1532.1276
Example 2
Output:
Returned float value is : 16322.128
Example 3
Output:
Returned float value is : 1632662.1
Example 4
Output:
Returned float value is : -165662.12
Next TopicJava BigDecimal