number.toFixed() returns a string, so the comparison is not numeric.
This should work:
amount = 5; total = 37.66; check = null; if(parseFloat(amount.toFixed(2)) >= parseFloat(total.toFixed(2))){ check = "amount IS GREATER"; }
However, this is a somewhat strange way to accomplish what you are trying to accomplish. How about this:
amount = 5; total = 37.66; check = null; if( Math.round(amount * 100) > Math.round(total * 100)) { check = "amount IS GREATER"; }
edit: semicolons added
source share