CStr Function

Converts any numeric expression to a string expression.


CStr (израз)

Врати вредност:



Expression: Any valid string or numeric expression that you want to convert.

Expression Types and Conversion Returns

Логичко :

String that evaluates to either True or False.

Датум :

String that contains the date and time.

Нула :

Run-time error.

Празно :

String without any characters.

Кој :

Corresponding number as string.

Zeros at the end of a floating-point number are not included in the returned string.

Error codes:

5 Invalid procedure call


Sub ExampleCSTR
Dim sVar As String
    MsgBox CDbl(1234.5678)
    MsgBox CInt(1234.5678)
    MsgBox CLng(1234.5678)
    MsgBox CSng(1234.5678)
    sVar = CStr(1234.5678)
    MsgBox sVar
End Sub

Please support us!