Format numbers with , (1,000)

This commit is contained in:
Danielv123 committed 2018-05-02 20:37:55 +02:00
1 parent 6816db0628
commit a0e98ecb00
1 file changed
+3
+3
View File
@@ -16,6 +16,9 @@ function drawcontents(data) {
//update existing rows or create new ones
data.forEach(function(item, i) {
// format count to have .s in it for large number readability (1,000,000)
item.count = item.count.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
let row = rows[i];
if(!row) {
row = document.createElement('tr');