Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more: , +
Dear Sir,

I Have column field


Weight float,

12.94854844771 kg


above weight 12kgs approximately.. Fraction values are 10 digits , how can i reduce fraction values to 3 digits... lik 12.949


Thank You...
Posted
Comments
Sergey Alexandrovich Kryukov 24-Feb-14 1:33am    
What's wrong with just reading standard MSDN documentation?
—SA

By using: Math.Round(yourVariable, 3, MidpointRounding.AwayFromZero);
 
Share this answer
 
Try this:
SQL
SELECT CAST(ROUND(columname, 10) AS NUMERIC(12,3))  from tablename
 
Share this answer
 

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



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