Can anyone please go through the code and let me know why converting from dollar to cents gives wrong result Steps: $32.5:Converting to cent->32*100=3200. value after decimal point is cent =0005. $10 to be charged extra if cost is less than $40 so $10 gets converted into cents as =1000 Summing up all the above three values we get in cents=4205. convert back to dollars=4205/100=$42.05.This is the process used to convert manually. but in reality ans should be $42.5. https://codepen.io/kvandana451/pen/wvLjBEa