An easy way to do this is:
var num = 1724.1000000000001;
num = Math.ceil(num * 100) / 100;
alert(num); // 1724.11
How it works:
Ceil will round the value up. But you want to have 2 decimal numbers. The best way to do this is to:
- Multiply the value with 100,
- Round it up,
- Divide it with 100.
Now you have an up rounded value with 2 decimals.
This is what happens:
1724.1000000000001 * 100 = 172410.00000000001
round-up on 172410.00000000001 = 172411
172411 / 100 = 1724.11