Siebel VB Language Reference > VB Language Reference >

Str Function

This standard VB function returns a string representation of a number.





The number to be represented as a string


A string representation of number.


The precision in the returned string is single precision for an integer or single-precision numeric expression; double precision for a long or double-precision numeric expression, and currency precision for currency. Variants return the precision of their underlying vartype.

The dollar sign ($) in the function name is optional. If it is specified, the return type is string. Otherwise the function returns a variant of vartype 8 (string).


This example prompts for two numbers, adds them, and then shows them as a concatenated string.

Sub Button_Click
   Dim x as Integer
   Dim y as Integer
   Dim str1 as String
   Dim value1 as Integer
   x = 1
   y = 2
   str1 = "The sum of these numbers is: " & x+y
   str1 = Str(x) & Str(y)
End Sub

Related Topics

Format Function
Val Function

Siebel VB Language Reference Copyright © 2006, Oracle. All rights reserved.