diff --git a/frontend/src/utils.js b/frontend/src/utils.js index 80816adf..c20e6eed 100644 --- a/frontend/src/utils.js +++ b/frontend/src/utils.js @@ -23,6 +23,7 @@ const htmlEntities = { export default class Utils { constructor(i18n) { this.i18n = i18n; + this.intlNumFormat = new Intl.NumberFormat(); } // Parses an ISO timestamp to a simpler form. @@ -78,6 +79,10 @@ export default class Utils { return out.toFixed(2) + pfx; } + formatNumber(v) { + return this.intlNumFormat.format(v); + } + // Parse one or more numeric ids as query params and return as an array of ints. parseQueryIDs = (ids) => { if (!ids) { diff --git a/frontend/src/views/Campaigns.vue b/frontend/src/views/Campaigns.vue index 8d265e11..7560bbb8 100644 --- a/frontend/src/views/Campaigns.vue +++ b/frontend/src/views/Campaigns.vue @@ -107,20 +107,20 @@

- {{ props.row.views }} + {{ $utils.formatNumber(props.row.views) }}

- {{ props.row.clicks }} + {{ $utils.formatNumber(props.row.clicks) }}

- {{ stats.sent }} / {{ stats.toSend }} + {{ $utils.formatNumber(stats.sent) }} / {{ $utils.formatNumber(stats.toSend) }}

- {{ props.row.bounces }} + {{ $utils.formatNumber(props.row.bounces) }}

diff --git a/frontend/src/views/Lists.vue b/frontend/src/views/Lists.vue index c08e980a..f48b2f00 100644 --- a/frontend/src/views/Lists.vue +++ b/frontend/src/views/Lists.vue @@ -65,7 +65,7 @@ :label="$t('globals.terms.subscribers')" header-class="cy-subscribers" numeric sortable centered> - {{ props.row.subscriberCount }} + {{ $utils.formatNumber(props.row.subscriberCount) }}