From a0e98ecb0078a36bcf48a80d47a1e636291f3019 Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Wed, 2 May 2018 20:37:55 +0200 Subject: [PATCH] Format numbers with , (1,000) --- static/storage.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static/storage.js b/static/storage.js index ad74f1af..dc138d7a 100644 --- a/static/storage.js +++ b/static/storage.js @@ -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');