JSFiddle - React, Tailwind, and code Playground
HTML
<span class="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();