如何计算2位数后的小数点 [英] How to calculate no. in 2 digit afte decimal point
本文介绍了如何计算2位数后的小数点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发Windows应用程序中的体重指数软件.我在计算小数点后2位数的BMI时遇到问题...如何计算
如果有人知道,请提前帮助我.谢谢.
i am developing the software for Body Mass Index in windows application. i have problem on calculating BMI in 2 digit after decimal point ...how can i calculate it
If any one knows please help me...Thanks in advance.
推荐答案
使用 ^ ]方法.
SELECT Cast(Round(12.3456,2,1) As Decimal(4,2))
如果仅使用Round
,它将返回12.3400,强制转换为Decimal
将截断结尾的零.
If you use only Round
it will return 12.3400, casting to Decimal
will truncate ending zeroes.
这篇关于如何计算2位数后的小数点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文