Export (0) Print
Expand All

CDbl Function

Updated: August 2009

Returns an expression that has been converted to a Variant of subtype Double.


                      CDbl(expression)

The expression argument is any valid expression.

Use the CDbl function to provide conversions from any data type to a Double subtype. For example, CDbl forces double-precision arithmetic when currency or integer arithmetic would normally occur.

The CDbl function uses the locale setting of your system to determine how to perform conversions. Different decimal separators are properly recognized depending on the locale setting, as are different thousand separators.

This example uses the CDbl function to convert an expression to a Double.

Dim MyCurr, MyDouble
MyCurr = CCur(234.456784)              ' MyCurr is a Currency (234.4568).
MyDouble = CDbl(MyCurr * 8.2 * 0.01)   ' Convert result to a Double (19.2254576).

Date

History

Reason

August 2009

Modified remarks.

Customer feedback.

Community Additions

Show:
© 2014 Microsoft