I've looked at tolocalestring() and it doesn't work.
I'm trying to have it to:
- 1,000,000
- 10,000,000
- ect...
Here is my code:
$(document).ready(function() {
var number = parseInt($('#test').text(), 10) || 309320350
number.toLocaleString();
// Called the function in each second
var interval = setInterval(function() {
$('#test').text(number++); // Update the value in paragraph
}, 1000); // Run for each second
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<p id="test"></p>