function TambahKoma(govlok) {
govlok += '';
w = govlok.split('.');
w1 = w[0];
w2 = w.length > 1 ? '.' + w[1] : '';
var rgw = /(\d+)(\d{3})/;
while (rgw.test(w1)) {
w1 = w1.replace(rgw, '$1' + ',' + '$2');
}
return w1 + w2;
}
Post a Comment