I have 2 number that I use Math.round to round it,for example I want if my number is 900.20 it rounded to 900.00 and if 12.80 it rounded to 13.
I use Math.round but 900.20 rounded to 910.00 but 12.8 rounded to 13 correctly.
var result1= Math.round(num1.toFixed(2));
var result2= Math.round(num2.toFixed(2));
Why you are using
.toFixed() function ?
Math.round() function and it will work. You don't need to convert it to string.