Overview | Methods | This Package | All Packages
Converts an object to a float value.
Syntax
public static float toFloat( Object value )
Parameters
value
The value to convert.
Return Value
Returns a float value that represents the object.
Exceptions
ClassCastException thrown if the argument cannot be converted.
Remarks
The following table lists the supported argument types and the resulting conversion.
Type | Conversion |
null | Returns 0. |
Character | Returns the character stored in the object. Produced by calling Character.charValue. |
Number | Returns the float value of the object. Produced by calling Number.floatValue. |
String | Returns the result of converting the numeric string to a float value. Produced by calling Float.valueOf. |
Variant | Returns the result of coercing the variant to a float value. Produced by calling Variant.toFloat. |
See Also toObject