Countup Rounded Up Random Decimals

In this example below you will see how to do a Countup Rounded Up Random Decimals with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by namimosha, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright namimosha ©
  • HTML
  • CSS
  • JavaScript
    <span id="counter"></span>

/*Downloaded from https://www.codeseek.co/namimosha/countup-rounded-up-random-decimals-oZoqvr */
    


/*Downloaded from https://www.codeseek.co/namimosha/countup-rounded-up-random-decimals-oZoqvr */
    var load = true;
var value = 0;
var increment = 0.3;
var final = 2.4;

function PerformCalc()
{
if (load == true && value <= final)
{
  value += increment

  if (value == final)
  {load = false;}
}

 document.getElementById('counter').innerHTML =  value.toFixed(1);
}

setInterval(PerformCalc, 1000);

Comments