diff --git a/app/templates/file.js b/app/templates/file.js
index 573302eb..d6558de5 100644
--- a/app/templates/file.js
+++ b/app/templates/file.js
@@ -1,5 +1,6 @@
const html = require('choo/html');
const assets = require('../../common/assets');
+const number = require('../utils').number;
function timeLeft(milliseconds, state) {
const minutes = Math.floor(milliseconds / 1000 / 60);
@@ -40,7 +41,9 @@ module.exports = function(file, state, emit) {
${remainingTime} |
- ${totalDownloads} / ${downloadLimit} |
+ ${number(totalDownloads)} / ${number(
+ downloadLimit
+ )} |
${options.map(
i =>
- html`${i}`
+ html`${number(
+ i
+ )}`
)}
`;
diff --git a/app/utils.js b/app/utils.js
index 9fea560c..e6d8d27b 100644
--- a/app/utils.js
+++ b/app/utils.js
@@ -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,
|