Partager via


CDbl Function

 

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

Syntax

CDbl(expression)

Remarks

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).

Requirements

Version 1

Change History

Date

History

Reason

September 2009

Modified remarks.

Customer feedback.

See Also

CBool Function
CByte Function
CCur Function
CDate Function
CInt Function
CLng Function
CSng Function
CStr Function