JSFiddle - React, Tailwind, and code Playground
HTML
<input id="n" valude=""/>
JavaScript
/*Numero a formatear*/
var NUM = 3500;
function format1(n, currency) {
return currency + " " + n.toFixed(2).replace(/./g, function(c, i, a) {
return i > 0 && c !== "." && (a.length - i) % 3 === 0 ? "," + c : c;
});
}
var salida = format1(NUM,"Bs.");
document.getElementById('n').value = salida;