Difference between revisions of "STR()"
Yvonne.milne (Talk | contribs) m (1 revision) |
Yvonne.milne (Talk | contribs) |
||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Function to perform numeric to string conversion | Function to perform numeric to string conversion | ||
− | |||
==Syntax== | ==Syntax== | ||
STR(<expN1> [,<expN2> [,<expN3> [,<expN4>]]]) | STR(<expN1> [,<expN2> [,<expN3> [,<expN4>]]]) | ||
− | |||
==See Also== | ==See Also== | ||
− | [[AT()]], [[ATNEXT()]], [[CAST()]], [[INLIST()]], [[INT()]], [[LEFT()]], [[OCCURS()]], [[RAT()]], [[RIGHT()]], [[SET STRESCAPE | + | [[AT()]], [[ATNEXT()]], [[CAST()]], [[INLIST()]], [[INT()]], [[LEFT()]], [[OCCURS()]], [[RAT()]], [[RIGHT()]], [[SET STRESCAPE]], [[STREXTRACT()]], [[STRTRAN()]], [[STRZERO()]], [[STUFF()]], [[SUBSTR()]], [[TRANSFORM()]], [[VAL()]] |
− | + | ||
==Description== | ==Description== | ||
Line 15: | Line 12: | ||
The string conversion can be returned in octal, decimal or hexadecimal when the optional expression <expN4> is specified as 8, 10 or 16, respectively. If <expN4> is not specified, the string is returned in decimal. If hexadecimal is specified then all alpha characters returned are in lower case. This function can be used in index expressions to add numeric and character field types together. | The string conversion can be returned in octal, decimal or hexadecimal when the optional expression <expN4> is specified as 8, 10 or 16, respectively. If <expN4> is not specified, the string is returned in decimal. If hexadecimal is specified then all alpha characters returned are in lower case. This function can be used in index expressions to add numeric and character field types together. | ||
− | |||
==Example== | ==Example== | ||
Line 23: | Line 19: | ||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] |
Revision as of 07:43, 13 February 2012
Contents
Purpose
Function to perform numeric to string conversion
Syntax
STR(<expN1> [,<expN2> [,<expN3> [,<expN4>]]])
See Also
AT(), ATNEXT(), CAST(), INLIST(), INT(), LEFT(), OCCURS(), RAT(), RIGHT(), SET STRESCAPE, STREXTRACT(), STRTRAN(), STRZERO(), STUFF(), SUBSTR(), TRANSFORM(), VAL()
Description
The STR() function converts the numeric expression <expN1> to a right justified character string of width <expN2>, rounded to <expN3> decimal places. If <expN2> is not specified, the string width defaults to 10. If <expN1> is wider than 10 or <expN2>, the STR() function returns a string of asterisks. If <expN3> is not specified, then <expN1> is treated as an integer.
The string conversion can be returned in octal, decimal or hexadecimal when the optional expression <expN4> is specified as 8, 10 or 16, respectively. If <expN4> is not specified, the string is returned in decimal. If hexadecimal is specified then all alpha characters returned are in lower case. This function can be used in index expressions to add numeric and character field types together.
Example
? str(1999.019,8,2) 1999.02