CCur (function)

Syntax

CCur(expression)

Description

Converts any expression to a Currency.

Comments

This function accepts any expression convertible to a Currency, including strings. A runtime error is generated if expression is Null or a String not convertible to a number. Empty is treated as 0.

When passed a numeric expression, this function has the same effect as assigning the numeric expression number to a Currency.

When used with variants, this function guarantees that the variant will be assigned a Currency (VarType 6).

Example

This example displays the value of a String converted into a Currency value.

Sub Main()

  i$ = "100.44"
  MsgBox "The currency value is: " & CCur(i$)
End Sub

See Also

CBool (function); CDate, CVDate (functions); CDbl (function); CInt (function); CLng (function); CSng (function); CStr (function); CVar (function); CVErr (function); Currency (data type).

More information

C