I've been trying to figure out how to insert commas into the result of this function for an hour now.
var i = 2574672248;
function increment2() {
i++;
document.getElementById('xxx').innerHTML = i;
}
setInterval('increment2()', 50);
The result is incremented by 1 every half a second. I'm trying to make it so, that if the result is 2394672248 for example, it's shown as "2,574,672,248" instead of the raw "2574672248". I've tried incorporating different comma inserting functions into it, but it's not working.