add thousands separator
This commit is contained in:
parent
c4ca8cdd5e
commit
ad361ec626
2 changed files with 10 additions and 3 deletions
|
|
@ -346,9 +346,9 @@ function ui_build() {
|
||||||
h.div({ _: "" }),
|
h.div({ _: "" }),
|
||||||
h.div({ _: "count", class: "top" }),
|
h.div({ _: "count", class: "top" }),
|
||||||
h.div({ _: "vertex", class: "side" }),
|
h.div({ _: "vertex", class: "side" }),
|
||||||
h.label({ _: t_vert }),
|
h.label({ _: util.comma(t_vert) }),
|
||||||
h.div({ _: "face", class: "side" }),
|
h.div({ _: "face", class: "side" }),
|
||||||
h.label({ _: t_face }),
|
h.label({ _: util.comma(t_face) }),
|
||||||
])
|
])
|
||||||
])];
|
])];
|
||||||
// bind elements to selectlist div
|
// bind elements to selectlist div
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,13 @@ let util = mesh.util = {
|
||||||
return uid.join('-');
|
return uid.join('-');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// add comma separator to 1000s
|
||||||
|
comma(val) {
|
||||||
|
let str = val.toString().split(".");
|
||||||
|
str[0] = str[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||||
|
return str.join(".");
|
||||||
|
},
|
||||||
|
|
||||||
// merge repeated function calls like updates
|
// merge repeated function calls like updates
|
||||||
// that importantly take no arguments
|
// that importantly take no arguments
|
||||||
defer(fn, time = 50) {
|
defer(fn, time = 50) {
|
||||||
|
|
@ -150,4 +157,4 @@ let util = mesh.util = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue