CStr Function

Converts any numeric expression to a string expression.

แƒกแƒ˜แƒœแƒขแƒแƒฅแƒกแƒ˜


Str (แƒ’แƒแƒ›แƒแƒกแƒแƒฎแƒฃแƒšแƒ”แƒ‘แƒ)

แƒ“แƒแƒ‘แƒ แƒฃแƒœแƒ”แƒ‘แƒฃแƒšแƒ˜ แƒ›แƒœแƒ˜แƒจแƒ•แƒœแƒ”แƒšแƒแƒ‘แƒ:

แƒกแƒขแƒ แƒ˜แƒฅแƒแƒœแƒ”แƒ‘แƒ˜

Parameters:

แƒขแƒ”แƒฅแƒกแƒขแƒ˜: แƒ—แƒฅแƒ•แƒ”แƒœแƒ—แƒ•แƒ˜แƒก แƒ แƒ”แƒ“แƒแƒฅแƒขแƒ˜แƒ แƒ”แƒ‘แƒ˜แƒกแƒ—แƒ•แƒ˜แƒก แƒกแƒแƒกแƒฃแƒ แƒ•แƒ”แƒšแƒ˜ แƒœแƒ”แƒ‘แƒ˜แƒกแƒ›แƒ˜แƒ”แƒ แƒ˜ แƒขแƒ”แƒฅแƒกแƒขแƒฃแƒ แƒ˜ แƒ’แƒแƒ›แƒแƒกแƒแƒฎแƒฃแƒšแƒ”แƒ‘แƒ.

Expression Types and Conversion Returns

Boolean :

String that evaluates to either True or False.

Date :

String that contains the date and time.

Null :

Run-time error.

Empty :

String without any characters.

Any :

Corresponding number as string.


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

Error codes:

D'oh! You found a bug (text/sbasic/shared/00000003.xhp#err5 not found).

แƒ›แƒแƒ’แƒแƒšแƒ˜แƒ—แƒ˜:


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!