I want to insert the commas appropriately between the numbers. eg: 6,350
is there any way I can achieve this in the following scenario
setTimeout(function () {
$('.number-counter').each(function () {
$(this).addClass('inView');
});
}, 500);
@property --num {
syntax: "<integer>";
initial-value: 0;
inherits: false;
}
.number-counter {
transition: --num 3s;
counter-set: num var(--num);
font: 800 40px system-ui;
}
.number-counter::after {
content: counter(num);
}
.number-counter.inView {
--num: var(--count);
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="number-counter" style="--count: 6350;"></div>