javascript moeda reais
snippet in javascript

javascript moeda reais

user392

var atual = 600000.00;

//com R$
var f = atual.toLocaleString('pt-br',{style: 'currency', currency: 'BRL'}).replace(".", ",");

//sem R$
var f2 = atual.toLocaleString('pt-br', {minimumFractionDigits: 2}).replace(".", ",");