I have a problem with Math.round () and Math.floor () in the setInterval () function using jQuery.
This is my code:
var number1 = 400; var up_up = setInterval( function (){ number1 = parseFloat(number1) + parseFloat(0.2548777); number1 = Math.round(number1); $('#number1').html(number1); }, 1000);
Math.round () or Math.floor () does not work, but when I use Math.ceil (), it works fine, but I want round or floor.
Please, help
Sayed source share