CCur

Coerces an expression to a Currency.

Syntax: CCur( expression )

expression
required Any valid string or numeric expression in the range -922,337,203,685,477.5808 to 922,337,203,685,477.5807.

The return type is Currency. If expression is outside that range, a run-time error occurs.

CCur forces currency arithmetic in cases where single-precision, double-precision, or integer arithmetic would normally occur.

CCur is the internationally aware alternative to Val for converting between data types. CCur recognizes different decimal separators, different thousand separators, and various currency options properly, depending on the system’s locale setting.

Example

This example uses the CCur function to convert an expression to a 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).

See Also