Checkerx
04-21-2010, 06:03 AM
I am doing a sum of length x width x price/m I then check to see if it is a whole number by doing (if round(total, 0) = total)
If it lands on a whole number (so say if length = 20 and width = 5); some prices (eg. 11.95 or 9.49) work fine and the IF statement says its true.
But certain numbers (eg. 8.96, 33.48, 18.99), even though it still equates to a whole number the IF statement returns it as false and performs the wrong functions.
So for example, 5 x 5 x 8.96 = 224. But then the line 'If Round(total, 0) = total' comes out as false
Does anyone know if there is something weird about these numbers that cause this error?
Here are the numbers I know that cause the problem: 8.96, 33.48,17.33, 17.99,18.99,19.99,37.02,40.91,32.70,68.01,37.60
And here are some numbers that work fine: 9.49,11.95,23.91,23.99,20.99,8.94,8.98,15.54,7.76,9.56
If it lands on a whole number (so say if length = 20 and width = 5); some prices (eg. 11.95 or 9.49) work fine and the IF statement says its true.
But certain numbers (eg. 8.96, 33.48, 18.99), even though it still equates to a whole number the IF statement returns it as false and performs the wrong functions.
So for example, 5 x 5 x 8.96 = 224. But then the line 'If Round(total, 0) = total' comes out as false
Does anyone know if there is something weird about these numbers that cause this error?
Here are the numbers I know that cause the problem: 8.96, 33.48,17.33, 17.99,18.99,19.99,37.02,40.91,32.70,68.01,37.60
And here are some numbers that work fine: 9.49,11.95,23.91,23.99,20.99,8.94,8.98,15.54,7.76,9.56