A short while ago I had posted about adding a comma to the value once it reached a certain number (1000).
At the moment, the value is going up $11 every second, although I would like to implement a change so that it goes up $11.43 every second.
For example: 0, $11.43, $22.86 ... and then when it reaches $1000 it should have the comma ($1,024.56). You should get the drift.
Here is my jsFiddle: http://jsfiddle.net/m9cey/14/
var millisecs = 1000;
setInterval(function() {
var $badge = $('#badge');
var num = parseInt($badge.text().replace(',', ''))+11;
$badge.text(num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","));
}, millisecs);
Any help will be much appreciated.
Cheers