我用这段代码打印了一些舍入输出。
Private Sub TestRound()
Dim i As Double
Dim vTest As Double
vTest = 17.005
For i = 1 To 10
Debug.Print vTest, Round(vTest, 2)
vTest = vTest + 0.01
Next i
End Sub
以下是输出(初始值,舍入值):
( 17.005, 17 )
( 17.015, 17.02 )
( 17.025, 17.03 )
( 17.035, 17.04 )
( 17.045, 17.05 )
( 17.055, 17.06 )
( 17.065, 17.07 )
( 17.075, 17.08 )
( 17.085, 17.09 )
( 17.095, 17.1 )