我有一个asp.net应用程序,我将在水晶报告中显示一个双字段。
我想把11.22展示为11
11.22
11
我使用Math.Truncate方法,但我得到了这个双11,00作为结果。
11,00
那么如何在不将其转换为整数的情况下解决此问题呢?
你有没有尝试过;
Math.Round(11.22)
虽然您需要了解舍入规则,但应该按照自己的意愿行事。
试试这个表达式:
Math.Floor(11.22)