JSFiddle - React, Tailwind, and code Playground

by Juan Muñoz

HTML

<p class="points">10999</p>
<p class="points">7898</p>
<p class="points2"></p>

JavaScript

function numberWithCommas(x) {
    return x.toString().replace(/\B(?=(?:\d{3})+(?!\d))/g, ".");
}


    $('.points').each(function(){
    var v_pound = $(this).html();
    v_pound = numberWithCommas(v_pound);

    $(this).html(v_pound)
        
        })