# Re: 四舍五入问题

Posted by jutso on March 02, 1999 at 09:18:43:

In Reply to: Re: 四舍五入问题 posted by nothing on March 01, 1999 at 16:46:29:

: : 请教高手 MsgBox (Round(4015 * 32.3 + 0.0000000001, 0))结果不会进位..
: sorry 说错了..MsgBox (Round(4015 * 32.3 ))不会进位,要像上前面例子加上一个值才能进位..请问有更好的方式吗?

把 4015 跟 32.3 存入 currency 型态的变数！
我是用 VB 5.0 的：

dim a as currency
dim b as currency

a = 4015
b = 32.3

msgbox (int((a * b) + 0.5))

如果小数多于两位，小数又不能有误差的话，你必须把所有数值
转成整数运算！

Follow Ups: