I am designing a cash register in which i have to compare 2 float values and i am getting an error every time while comparing it .i.e because i cannot round off the difference in the amount up to 2 decimal digits and compare it with values.
for eg. if the amount paid by the customer is 60.36 and the Bill issued is of 30.24 the difference coming out is 30.120001 . I even tried using floor function to round it off to two decimal digits : floorf(diff*100+.5)/100; but it doesn't work.
How should i round off the decimal digits and use them in designing a cash register??