如何四舍五入并保留2位小数

applefzu 2010-03-19 11:54:00
为什么@Text(@Round(137.605;0.01))得出的结果是137.6??
四舍五入并保留2位小数 要怎么实现啊?
...全文
221 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
cnscns 2010-03-22
  • 打赏
  • 举报
回复
我已经说了,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
applefzu 2010-03-22
  • 打赏
  • 举报
回复
请教高手啊?没人知道吗?
applefzu 2010-03-22
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 cw11415 的回复:]
我试了一下lz的公式得出的试137.61

为什么你得出的没那个1??
[/Quote]
晕,我也很纳闷,请问你用什么版本的?
cnscns 2010-03-19
  • 打赏
  • 举报
回复
Notes的四舍五入有问题。你试试看137.6051。
cw11415 2010-03-19
  • 打赏
  • 举报
回复
我试了一下lz的公式得出的试137.61

为什么你得出的没那个1??

535

社区成员

发帖
与我相关
我的任务
社区描述
企业开发 Exchange Server
社区管理员
  • 消息协作社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧