Dinesh thykkalat Posted January 12, 2021 Share Posted January 12, 2021 result of SELECT STR(39.775,15,2); have doubts result should be 39.78 but its output is 39.77 Link to comment Share on other sites More sharing options...
niche Posted January 14, 2021 Share Posted January 14, 2021 After playing around with that function at https://www.w3schools.com/sql/trysqlserver.asp?filename=trysql_func_sqlserver_str2 , the function obviously has a rounding feature. Link to comment Share on other sites More sharing options...
Sherin Posted February 25, 2021 Share Posted February 25, 2021 (edited) If you have tried SELECT STR(39.776, 15, 2); So your result is 39.78 Edited February 25, 2021 by Sherin Link to comment Share on other sites More sharing options...
dsonesuk Posted February 25, 2021 Share Posted February 25, 2021 But! Wait! If we put STR(39.78,15,2); We also get 39.78 thats amazing, so basically if i change value to what I want! Win, Win! and i thought this was going to be difficult. Link to comment Share on other sites More sharing options...
dsonesuk Posted February 25, 2021 Share Posted February 25, 2021 Try STR(ROUND(39.775,2),15,2) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now