vba - Round(0.005) 会给出错误的结果吗?

标签 vba excel rounding

当我进入时

Debug.Print(Round(0.005, 2))
 0

在 VBA (Excel 2010) 的立即窗口中,我得到 0 结果。我预计0.01

我无法想象 VBA 计算错误,那么我做错了什么?

最佳答案

银行家舍入与算术舍入的事情

  = Round(variable + 0.000001, 0)

关于vba - Round(0.005) 会给出错误的结果吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42419089/

相关文章:

Excel VBA 帮助文档安装

vba - Excel VBA : how to access and control the "Sheet Select" dialog?

html - VBA单击没有名称的HTML按钮?

Excel VBA 列出键绑定(bind)(OnKey ?)

excel - 从 excel 表中填充工作表

c# - 仅转换特定值的有效方法

python - 在 Python 2.7 中舍入到小数点后两位?

python - 在 Python 中随机舍入为整数

vba - 另存为 .csv 正确的小数分隔符

vba - 使用 VBA 将值设置为 .Function