Correct me if i'm wrong, but the round function in vb/vba isn't really correct ex
round(1.125,2) returns 1.12 in stead of 1.13
round(1.135,2) returns 1.13 ...
To prevent this we wrote our own function the display it correct.
Public Function MyRound(paValue As Double, paPrecision As Integer) As Double
Dim loSign As Integer
Dim loRoundPart As Double
Dim loFactor As Double
loSign = Math.Sgn(paValue)
loFactor = MyExp(10, CDbl(paPrecision))
loRoundPart = 0.5 / loFactor
MyRound = Fix((paValue + loSign * loRoundPart) * loFactor) / loFactor
End Function
Public Function MyExp(paValue As Double, paExp As Double) As Double
MyExp = Exp(paExp * Log(paValue))
End Function
Regards
Jurgen