CCur Function

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

                      CCur(expression)

Remarks

The expression argument is any valid expression.

Use the CCur function to provide conversions from any data type to a Currency subtype. For example, CCur forces currency arithmetic when integer arithmetic would normally occur.

The CCur 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.

The following example uses the CCur function to convert an expression to Currency:

Dim MyDouble, MyCurr
MyDouble = 543.214588         ' MyDouble is a Double.
MyCurr = CCur(MyDouble * 2)   ' Convert result of MyDouble * 2 (1086.429176) to a Currency (1086.4292).

Requirements

Version 1

See Also

Reference

CBool Function

CByte Function

CDate Function

CDbl Function

CInt Function

CLng Function

CSng Function

CStr Function

Change History

Date

History

Reason

August 2009

Modified remarks.

Customer feedback.