STR() converts a numeric value to a string : STR « String Functions « SQL Server / T-SQL Tutorial






STR() accepts three arguments: the numeric value, the overall length, and the number of decimal positions.

If the integer part of the number and decimal positions is shorter than the overall length,
the result is left-padded with spaces.
9>
10> SELECT STR(123.4, 8, 4)
11> GO

--------
123.4000

(1 rows affected)








12.20.STR
12.20.1.STR() converts a numeric value to a string
12.20.2.STR takes a numeric value and changes the data type to a char.
12.20.3.STR(float_expression, character_length, number_of_decimal_places)
12.20.4.SELECT STR(123.456789, 8, 4)
12.20.5.SELECT STR(1, 6, 4)
12.20.6.SELECT STR(1, 12, 4)