I have an array look like these :
console.log(myArray);
myArray: [100000, 300000, 20000000, 3450000, 610000]
What I want to do is converting my array into like these:
myArray: [100.000, 300.000, 20.000.000, 3.450.000, 610.000]
So far, I've tried code:
for (let i = 0; i < myArray.length; i++) {
const element = (myArray[i]/1000).toFixed(3);
}
console.log(element);
But it seems didn't work at all. Anyone can help me to solve these?
Thanks.