Just an FYI
I was just bitten in the Access VBA by this ... idiosyncrasy,
Note the difference in rounding of the same number when it's Single vs Double.
VB Code:
Public Sub Test_Round() Dim sngX As Single Dim dblX As Double sngX = 45.315 dblX = 45.315 Debug.Print Round(sngX, 2) ' = 45.31 Debug.Print Round(dblX, 2) ' = 45.32 End Sub
I'm sure there's a very good explanation for this, that will go right over my head, like "Haven't you heard of 'Drunken Banker's Rounding?'
It (mis)behaves the same way in Access VBA, VB6 and VB.NET,
so, I'll give MS points for keeping their inconsistency consistent.




Reply With Quote