JSFiddle - React, Tailwind, and code Playground
HTML
<div class="counter">0</div>
JavaScript
var max = 2;
function incCounter() {
var currCount = parseFloat($('.counter').html());
currCount += .01;
$('.counter').text( currCount.toFixed(2) );
if (currCount < max)
setTimeout(incCounter,50);
}
incCounter();