显示double属性的小数部分

问题描述 投票:1回答:2

我有一个asp.net应用程序,我将在水晶报告中显示一个双字段。

我想把11.22展示为11

我使用Math.Truncate方法,但我得到了这个双11,00作为结果。

那么如何在不将其转换为整数的情况下解决此问题呢?

asp.net vb.net crystal-reports format double
2个回答
2
投票

你有没有尝试过;

Math.Round(11.22)

虽然您需要了解舍入规则,但应该按照自己的意愿行事。


1
投票

试试这个表达式:

Math.Floor(11.22)
© www.soinside.com 2019 - 2024. All rights reserved.