J
Jesper F
I'm fiddling with a function and I'm encountering something strange - what's
going on?
It seems the decimals are off.
Function MyRound(sngNumber As Single) As Single
Dim iInt As Integer
Dim sngRest As Single
iInt = Int(sngNumber)
sngRest = sngNumber - iInt
MyRound = sngRest
End Function
?MyRound(5.31) = 0.3099999
?MyRound(5.30) = 0.3000002
?MyRound(5.29) = 0.29
?MyRound(5.28) = 0.2800002
/ Jesper
going on?
It seems the decimals are off.
Function MyRound(sngNumber As Single) As Single
Dim iInt As Integer
Dim sngRest As Single
iInt = Int(sngNumber)
sngRest = sngNumber - iInt
MyRound = sngRest
End Function
?MyRound(5.31) = 0.3099999
?MyRound(5.30) = 0.3000002
?MyRound(5.29) = 0.29
?MyRound(5.28) = 0.2800002
/ Jesper