Click here to Skip to main content
15,609,553 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
i am developing the software for Body Mass Index in windows application. i have problem on calculating BMI in 2 digit after decimal point can i calculate it

If any one knows please help me...Thanks in advance.
Herman<T>.Instance 25-Aug-11 4:24am    
first: show your code? so we can see sharp what your problem is.
DO you use e decimal? or should sql2005 result in 2 decimals?

Use the Math.Round[^] method.
Share this answer
SELECT Cast(Round(12.3456,2,1) As Decimal(4,2)) 

If you use only Round it will return 12.3400, casting to Decimal will truncate ending zeroes.
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