Difference between revisions of "STR()"

From Recital Documentation Wiki
Jump to: navigation, search
Line 1: Line 1:
=STR()=
 
 
 
 
==Class==
 
==Class==
 
Expressions And Type Conversion
 
Expressions And Type Conversion
Line 35: Line 32:
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 +
[[Category:String Data]]
 +
[[Category:String Data Functions]]
 +
[[Category:Expressions and Type Conversion]]
 +
[[Category:Expressions and Type Conversion Functions]]

Revision as of 15:45, 2 June 2009

Class

Expressions And Type Conversion


Purpose

Function to perform numeric to string conversion


Syntax

STR(<expN1> [,<expN2> [,<expN3> [,<expN4>]]])


See Also

AT(), ATNEXT(), INLIST(), INT(), LEFT(), OCCURS(), RAT(), RIGHT(), 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


Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer