An awesome replacement for .innerText / .innerHTML
$ npm install spinteger --save
$ bower install spinteger --save
or use CDN
<script src="https://spinteger.maksymblank.com/dist/spinteger.min.js"></script>
<script src="bower_components/spinteger/dist/spinteger.min.js"></script>
import spinteger from 'spinteger'
var spinNumber = spinteger(document.querySelection('#number'));
spinNumber.val(1230329) // any number
<span id="number">1873656</span>
var num = spinteger(document.querySelector('#number'),{
fontSize: 40, // Default: inherit or 16px
separator: '#', // Default: ''
tofixed: 2, // Default: 0
step: 2, // Default: 1
speed: 100, // Default: 50
before: '$', // Default: ''
after: '$' // Default: ''
});
num.val(3892382);