Returns the string equivalent of a number.
Parameter |
Description |
---|---|
numeric-expression |
Any approximate numeric (FLOAT, REAL, or DOUBLE precision) expression. |
length |
The number of characters to be returned (including the decimal point, all digits to the right and left of the decimal point, the sign, if any, and blanks). The default is 10 and the maximum length is 255. |
decimal |
The number of digits to the right of the decimal point to be returned. The default is 0. |
VARCHAR
The following statement returns a string of six spaces followed by 1234, for a total of ten characters:
SELECT STR( 1234.56 ) FROM iq_dummy
The following statement returns the result 1234.5:
SELECT STR( 1234.56, 6, 1 ) FROM iq_dummy