Developer Documentation Library > UNICOM Intelligence Function Library > Conversion functions > CDouble
 
CDouble
Converts a value of any data type to a Double value.
Syntax
CDouble(<value>)
Parameters
<value>
Type: None
Variant value to be converted.
(return)
Type: Double
Double value derived from <value>.
Notes
This function is similar to CDbl in Visual Basic.
The result of the conversion depends on the data type of <value>, as follows:
Boolean: The return value is 1.0 (True) or 0.0 (False).
Categorical: An error occurs.
Double: <value> is returned unchanged.
Date: The return value is the floating-point number used internally to represent the date.
Long: The return value is equal to <value>, with a fractional part of zero.
NULL values: If <value> is NULL, the return value is 0.0.
Object: If the object has a default property, the value of that property is converted. Otherwise an error occurs.
Text: The string is parsed according to the locale to extract the value. An error occurs if the string does not contain a properly formatted double.
Examples
Data type
Value
Result
Boolean
True
1.0
Long
345
345.0
Double
56.798
56.798
Text
14 April 2001 20:30:02
36995.8541898148
Text
Fossils
Error
Categorical
{5,3,1,9}
Error
See also
CBoolean
Conversion functions