podria ser asi:
Código Javascript
:
Ver originalvar 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;
MUESTRA:
http://jsfiddle.net/2bxq5zt2/