如何在 rdlc 报告中四舍五入小数值
How to round decimal value in rdlc reports
我在 rdlc 报告中使用了一个简单的公式。我想使用前向舍入,例如我的值为 25.17,我想转换为 26 而不是 25。
但是下面的公式给我结果 = 25.
=ROUND(Sum(Fields!Total.Value, "DataSet1") + First(Fields!Shipping.Value, "DataSet1") - First(Fields!Discount.Value, "DataSet1"),0)
提前致谢
大多数编程语言都有 Round
、Floor
和 Ceiling
函数。下限向下舍入,上限向上并四舍五入到最接近的值。
天花板函数的进一步阅读https://msdn.microsoft.com/en-us/library/system.math.ceiling%28v=vs.110%29.aspx
在您的 Expression
中,使用 Ceiling
函数代替 Round
。
=Ceiling(Sum(Fields!Total.Value, "DataSet1") + First(Fields!Shipping.Value, "DataSet1") - First(Fields!Discount.Value, "DataSet1"))
我在 rdlc 报告中使用了一个简单的公式。我想使用前向舍入,例如我的值为 25.17,我想转换为 26 而不是 25。 但是下面的公式给我结果 = 25.
=ROUND(Sum(Fields!Total.Value, "DataSet1") + First(Fields!Shipping.Value, "DataSet1") - First(Fields!Discount.Value, "DataSet1"),0)
提前致谢
大多数编程语言都有 Round
、Floor
和 Ceiling
函数。下限向下舍入,上限向上并四舍五入到最接近的值。
天花板函数的进一步阅读https://msdn.microsoft.com/en-us/library/system.math.ceiling%28v=vs.110%29.aspx
在您的 Expression
中,使用 Ceiling
函数代替 Round
。
=Ceiling(Sum(Fields!Total.Value, "DataSet1") + First(Fields!Shipping.Value, "DataSet1") - First(Fields!Discount.Value, "DataSet1"))