0
I have a function that does a count, only I need to add mask to this value. The final value is 3000 only I need for 3.000;
there is how to change the value of integer to another format and do even so counting within the function itself?
Follows function:
function numerosHome(id, inicialValor, valorFinal){
var inicial = inicialValor;
var location = document.getElementById(id);
var contador = setInterval(() => {
location.innerHTML = inicial;
inicial++;
var final = valorFinal +1;
if(inicial == final){
clearInterval(contador);
}
},0.5);
}
numerosHome('numeros', 2800, 3000);
#numeros{
font-size: 50px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="numeros">
</div>