localize other displayed numbers
This commit is contained in:
parent
a777a808ee
commit
cf36a33aea
3 changed files with 17 additions and 2 deletions
|
@ -117,6 +117,14 @@ function percent(ratio) {
|
|||
return `${Math.floor(ratio * 100)}%`;
|
||||
}
|
||||
|
||||
function number(n) {
|
||||
if (LOCALIZE_NUMBERS) {
|
||||
const locale = document.querySelector('html').lang;
|
||||
return n.toLocaleString(locale);
|
||||
}
|
||||
return n.toString();
|
||||
}
|
||||
|
||||
function allowedCopy() {
|
||||
const support = !!document.queryCommandSupported;
|
||||
return support ? document.queryCommandSupported('copy') : false;
|
||||
|
@ -171,6 +179,7 @@ module.exports = {
|
|||
allowedCopy,
|
||||
bytes,
|
||||
percent,
|
||||
number,
|
||||
copyToClipboard,
|
||||
arrayToB64,
|
||||
b64ToArray,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue