Convert Expression to Double-Precision Method
The Convert Expression to Double-Precision method converts the value that the expression argument contains to a double-precision number. It returns this number. Note the following:
A string that cannot convert to a double-precision floating point number causes a Type Mismatch error.
A variant that contains a null result causes an Illegal Use of Null error.
For more information, see Numeric Data Types That Siebel VB Uses.
Format
CDbl(expression)
For information about the arguments that you can use with this method, see Argument That You Can Use with Conversion Methods.
Example
The following example calculates the square root of 2 as a double-precision, floating-point value and displays it in scientific notation:
Sub Button_Click
Dim value
Dim msgtext
value = CDbl(Sqr(2))
msgtext = "The square root of 2 is: " & Value
End Sub