JSFiddle - React, Tailwind, and code Playground

by Dennis Betman

HTML

<span class="euro">&euro;</span>
<span class="number">34332545,50</span>

JavaScript

$.fn.digits = function(){ 
    return this.each(function(){ 
        $(this).text( $(this).text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1.") ); 
    })
}

$(".number").digits();