STR$ function

Purpose: STR$ converts a number to a string. Note well that a space is prepended to the returned string if the number is positive. This space is actually a part of the number and is the location of the sign. When it's a negative number, there will be a minus there and when it's a positive number, it'll be blank.


 Syntax:

 RetStr$ = STR$(Number)

 Parameters:

  • RetStr$ Returned string converted from Number parameter. Note well that a space is prepended to the returned string if the number is positive. This space is actually a part of the number and is the location of the sign. When it's a negative number, there will be a minus there and when it's a positive number, it'll be blank.
  • Number Integer or floating point literal or variable.

Example:


 A$ = STR$(3.14159)

BCX Console Sample Programs using STR$ function.

S04.bas, S10.bas, S19.bas, S24.bas, S54.bas, S70.bas, S89.bas, S92.bas, S107.bas