Converts an object to a double value.
public static double toDouble( Object value )
value
The value to convert.
Returns a double value that represents the object.
ClassCastException thrown if the argument cannot be converted.
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 double value of the object. Produced by calling Number.doubleValue. |
String | Returns the result of converting the numeric string to a double value. Produced by calling Double.valueOf. |
Time | Returns the double value of the object. Produced by calling Time.toDouble. |
Variant | Returns the result of coercing the variant to a double value. Produced by calling Variant.toDouble. |
See Also toObject