STR(number)

Returns the text string of a number (String).


numberThe valid expression (Long).

REMARKS
* When numbers are converted to strings, a leading space is always reserved for the sign of "number".
* If "number" is positive, the returned string contains a leading space and the plus sign is implied.
* This function recognizes only the period (.) as a valid decimal separator.
* When you need to use different decimal separators (for example, in international applications), use the CSTR function to convert a number to a string.
* You can use the CSTR function to convert anything that is not a number to a string.
* You can use the FORMAT function to convert a number or date to a particular format.
* You can use the STRCOMP function to return the result of a string comparison.
* You can use the STRREVERSE to return a text string with the characters reversed.
* You can use the STR$ function to return a String data type instead of a Variant/String data type.
* The equivalent .NET function is Microsoft.VisualBasic.Conversion.Str
* For the Microsoft documentation refer to docs.microsoft.com

Debug.Print Str(459)    '= " 459"  - notice the space in front  
Debug.Print Str(8.24) '= " 8.24" - notice the space in front
Debug.Print Str(0.24) '= " .24" - notice the space in front
Debug.Print Str(10) '= " 10" - notice the space in front

Dim sResult As String
sResult = Str(100)
Debug.Print sResult

© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited Top