Str Function

Converte unha expresión numérica nunha cadea.

Sintaxe:

Str (Expresión)

Valor de retorno:

Cadea

Parámetros:

Expresión: Calquera expresión numérica.

The Str function converts a numeric variable, or the result of a calculation into a string. Negative numbers are preceded by a minus sign. Positive numbers are preceded by a space (instead of the plus sign).

Códigos de erro

5 Chamada de procedemento incorrecta

Exemplo:

Sub ExampleStr

Dim iVar As Single

Dim sVar As String

    iVar = 123.123

    sVar = LTrim(Str(iVar))

    MsgBox sVar & chr(13) & Str(iVar)

End Sub