I want a little timer which increases with the help of setInterval()
the number in a html container.
My code looks like this (jsfiddle):
var currentTime = 0;
window.setInterval(timer, 100)
function timer() {
currentTime = currentTime + 0.1;
$('#time').text(currentTime);
}
Unfortunately this does not only add 0.1 each interval but add 0.1000001 (or something similar). Can someone explain me why?