Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I wish to display 2.55555 to 2.555 not 2.550,FOR this which function is used in sql
ltrim(str(CONVERT(NUMERIC(20),(CONVERT(NUMERIC(20),ISNULL(Quantity_Rejected,0)*100))/CONVERT(NUMERIC(20),ISNULL(Quantity_Recieved,0))),40,@INV_Precision)) AS Fallout this is my query to execute
Posted
Updated 2-Apr-14 2:09am
v2

1 solution

hi,
try this...
SQL
DECLARE @val NUMERIC(10,5) = 2.55555
SELECT convert(NUMERIC(10,3), round(@val,3,1))

Happy coding!
:)
 
Share this answer
 
v2
Comments
Maciej Los 2-Apr-14 13:36pm    
Excellent!
+5!
Aarti Meswania 3-Apr-14 0:14am    
Thank you! Maciej Los :)
Member 10685464 4-Apr-14 0:54am    
Thank you
Aarti Meswania 4-Apr-14 1:11am    
welcome :)
didn't get you please give an example
Member 10685464 4-Apr-14 1:13am    
solved the question

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900