STR

Description

Returns character data converted from numeric data. The character data is right-justified, with a specified length and decimal precision. (STR in Transact-SQL).

Sample Source Pattern

Syntax

STR ( float_expression [ , length [ , decimal ] ] ) 

Arguments

numeric_expression: Float expression with a decimal point.

length (Optional): Length that the returning expression will have, including point notation, decimal, and float parts.

decimal(Optional): Is the number of places to the right of the decimal point.

Return Type

VARCHAR.

Examples

Input:

IN -> SQLServer_01.sql
/* 1 */
SELECT STR(123.5);

/* 2 */
SELECT STR(123.5, 2);

/* 3 */
SELECT STR(123.45, 6);

/* 4 */
SELECT STR(123.45, 6, 1);

Output:

1) 124
2) **
3) 123
4) 123.5

Known Issues

No issues were found.

No related EWIs.

Last updated