I am developing a website using html, css, jQuery.
I am trying to show some stats that will be kind of numbers say: 376766 user registered
But I am doing it by data-
attribute:
<strong class="datafill1" data-to="">0</strong>
Here I pass data-to
by a random script generator.
Problem is that I want to separate numbers by comma but I am not able to do
Please help me
- Current Format :376766
- Desired Format : 3,76,766
I am trying it but not able to do it :(
Update : Here is the script: //-------------------------fake counter 1
function fakecounter1(){
//decrease/increase counter value (depending on perceived popularity of your site!)
var decrease_increase=11439
var counterdate=new Date()
var currenthits=counterdate.getTime().toString()
currenthits=parseInt(currenthits.substring(2,currenthits.length-4))+decrease_increase
var df1=currenthits -2746740;
$('.datafill1').attr('data-to', df1);
}
fakecounter1()