Format numbers with commas.

This commit is contained in:
FireMasterK
2021-06-03 00:22:58 +05:30
parent 366d81a546
commit c594dc51b2
2 changed files with 7 additions and 3 deletions

View File

@@ -49,6 +49,10 @@ const mixin = {
}
return (num / si[i].value).toFixed(digits).replace(rx, "$1") + si[i].symbol;
},
addCommas(num) {
num = parseInt(num)
return num.toLocaleString('en-US')
},
fetchJson: function (url, options) {
return fetch(url, options).then(response => {
return response.json();