Cách 1:
Number(10000).toLocaleString('en'); // "10,000"
cách 2:
function commaSeparateNumber(val){
while (/(\d+)(\d{3})/.test(val.toString())){
val = val.toString().replace(/(\d+)(\d{3})/, '$1'+','+'$2');
}
return val;
}
$('#elementID').html(commaSeparateNumber(1234567890));