To round a number to 2 decimals:
var num = 1724.1000000000001;
num = Math.ceil(num*100)/100;
// num == 1724.11
Or, try this:
var num = 1724.1000000000001;
function round(num, decimals){
var d = Math.pow(10,decimals)
return Math.ceil(num*d)/d;
}
console.log(round(num,0))
console.log(round(num,1))
console.log(round(num,2))
console.log(round(num,3))
console.log(round(num,4))
// 1725
// 1724.2
// 1724.11
// 1724.101
// 1724.1001