Varkon MBS Programmers manual
Converts an int or float value to a string of characters with optional formatting.
s:=str(number, width, precision); string s; int/float number; int width; int precision;
number | - The int or float value to convert. |
width | - The number of character positions that will be used. |
- If width is negative, characters will be left justified. | |
- If width is positive, characters will be right justified. | |
- If width is less than the characters needed, it is automatically increased. | |
- If width is larger than the characters needed, spaces are added. | |
precision | - Controls the number of decimal places. A value of -1 gives E-notation. |
A STRING value equal to the result of the conversion.
s:=str(12345,1,0); ! Eeual to s:="12345"; s:=str(12345,10,0); ! Equal to s:=" 12345"; s:=str(12345,-10,0); ! Equal to s:="12345 "; s:=str(12345,-10,2); ! Equal to s:="12345.00 ": s:=str(12345,-15,-1); ! Equal to s:="1.234500e+04 ": s:="PI="+str(pi,1,5); ! Equal to s:="PI=3.14159";
Varkon 1.19D svn # 120M