SQL Server Reporting Services Round()函数 [英] SQL Server Reporting Services Round() function
本文介绍了SQL Server Reporting Services Round()函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有一些奇怪的事情发生在我的报告生成的SQL Server报告服务,我希望我不是太蠢。我使用Round函数获取整数。有时一个4.5将舍入到4和一个5.5将舍入到6.这是因为舍入方法吗?我使用这个:
there is some bizarre thing happening with my report generated in SQL Server Reporting Services and I hope I am not being too stupid. I use the Round function to get integers. Sometimes a 4.5 will round to 4 and a 5.5 will round to 6. Is this because of the rounding method? I am using this:
Round(Fields!GroupAverageAssessment.Value,0)
如何进行常规舍入(4.5到5,3.5到4,6.5到7等等)
How can I make a regular rounding (4.5 to 5, 3.5 to 4, 6.5 to 7 and so on...)
感谢
推荐答案
这听起来像 round to even ,也称为Banker的舍入。
It sounds like round to even, also known as Banker's rounding.
从零开始,这是你想要的:
The other option is "away from zero", which is what you want:
Round(4.5, 0, MidpointRounding.AwayFromZero)
这篇关于SQL Server Reporting Services Round()函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文