I'm trying to compare a calculated currency total to a total in the database stored as a float. I'm having trouble with values that seem equal but in fact are not equal due to approximation. I thought I could do something like if (Math.abs(value1-value2)>0.01D) //the numbers are not equal but that doesn't seem to work either. How do you successfully compare currency values for equality?