<script>
document.addEventListener("DOMContentLoaded", function() {
(function () {
function divideNumberByPieces(x, delimiter) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, delimiter || " ");
};
const tCalc = document.querySelectorAll(".tn-atom__form .t-calc__hiddeninput");
tCalc.forEach(function (el, index) {
el.addEventListener('change',function(e) {
setTimeout(function () {
$(function() {
const cLnum = 'a[href="#numgrow"]';
const numb_start = +document.querySelector(cLnum).innerHTML.replace(/\D+/g,"");
const numb_end = document.querySelector('input[name="total"]').value;
$({numberValue: numb_start}).animate({numberValue: numb_end}, {
duration: 1700,
easing: "swing",
step: function(val) {document.querySelector(cLnum).innerHTML = divideNumberByPieces(Math.ceil(val));
}
});
});
}, 300);
});
});
})();
});
</script>