I am trying to truncate double values in a query to 2 decimal places (i.e. round them down). As far as I am aware, there is not a "round down" function in vba, and so I have implemented the following method:
This, most of the time, works well. However, when I try the expression ( 5 * 85.41 ), which is equal to 427.05, i.e.
I get 427.04. If I try
I get 427.05, which is the correct value.
Something subtle is happening here which I'm not picking up on. Can anyone explain what is happening?
Thanks.
Code:
FIX( expression * 100 ) / 100
Code:
fix( 5 * 85.41 * 100 ) / 100
Code:
Dim a As Double a = 5 * 85.41 * 100 MsgBox (Fix(a) / 100)
Something subtle is happening here which I'm not picking up on. Can anyone explain what is happening?
Thanks.
Comment