mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 08:23:12 +09:00
Format numbers with , (1,000)
This commit is contained in:
1 parent
6816db0628
commit
a0e98ecb00
1 file changed
+3
@@ -16,6 +16,9 @@ function drawcontents(data) {
|
|||||||
|
|
||||||
//update existing rows or create new ones
|
//update existing rows or create new ones
|
||||||
data.forEach(function(item, i) {
|
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];
|
let row = rows[i];
|
||||||
if(!row) {
|
if(!row) {
|
||||||
row = document.createElement('tr');
|
row = document.createElement('tr');
|
||||||
|
|||||||
Reference in new issue
Block a user