Article ID: 154000
Article Last Modified on 3/16/2005
declare @x1 numeric(8,6), @x2 numeric(8,6) select @x1 = 12.104375, @x2 = 12.128175 select str(@x1, 9, 5) STR, round(@x1, 5) ROUND select str(@x2, 9, 5) STR, round(@x2, 5) ROUNDThe @x1 numeric value 12.104375 is first converted to float 12.104374999999999. The STR() function then rounds the fractional part of the number to the decimal you specified. In this example, STR() rounds 12.104374999999999 to 12.10437 (5 decimal places).
Keywords: kbbug kbprb KB154000