toDouble()

Converts an object or primitive data type to a Double object.

Syntax

Double toDouble(Object objectData)
 Double toDouble(int integerData)
 Double toDouble(float floatData)
 Double toDouble(double doubleData)
 

Parameters

objectData
A Java object. The objects currently supported are: Float, Integer, and String.
integerData
Any primitive int variable.
floatData
Any primitive float variable.
doubleData
Any primitive double variable.

Return values

Returns a Double object.

Exceptions

DtpIncompatibleFormatException - If the source data type cannot be converted to Double.

Examples

Double myDoubleObj = DtpDataConversion.toDouble(myInteger);
 

See also

getType(), isOKToConvert(), toPrimitiveDouble()

Copyright IBM Corp. 2003