读书人

怎么四舍五入并保留2位小数

发布时间: 2012-03-11 18:15:39 作者: rapoo

如何四舍五入并保留2位小数
为什么@Text(@Round(137.605;0.01))得出的结果是137.6??
四舍五入并保留2位小数 要怎么实现啊?

[解决办法]
Notes的四舍五入有问题。你试试看137.6051。
[解决办法]
我试了一下lz的公式得出的试137.61

为什么你得出的没那个1??
[解决办法]
我已经说了,Notes的舍入有问题,和别的不一样,看看帮助里面的说明:
Round returns a Double.
If the first non-significant digit is 5, and all subsequent digits are 0, the last significant digit is rounded to the nearest even digit. See the example that follows.

如果第一个要舍入的数是5,后面其他的位都是0,那么这个数就会被舍入到最近的偶数。
示例:
' Round to one decimal place.
Print Round(4.23, 1) ' Prints 4.2
Print Round(4.35, 1) ' Prints 4.4
Print Round(4.45, 1) ' Prints 4.4

读书人网 >行业软件

热点推荐