Script:
var number;
number = 1000000;
number.toLocaleString();
number.toLocaleString('id-ID');
number = 1500000.59
number.toLocaleString();
number.toLocaleString('id-ID');
Output:
"1,000,000"
"1.000.000"
"1,500,000.59"
"1.500.000,59"
Script:
var number;
number = 1000000;
number.toLocaleString();
number.toLocaleString('id-ID');
number = 1500000.59
number.toLocaleString();
number.toLocaleString('id-ID');
Output:
"1,000,000"
"1.000.000"
"1,500,000.59"
"1.500.000,59"