From 5addd304ef956fd5512875d3c36cb8fdb0b2403f Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Tue, 8 Nov 2022 12:47:02 +0100 Subject: [PATCH] Localise subscriber count on the watch page (#2841) --- src/renderer/views/Watch/Watch.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index f6ee6ee19..61d4aceac 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -367,12 +367,10 @@ export default Vue.extend({ const subCount = result.videoDetails.author.subscriber_count if (typeof (subCount) !== 'undefined' && !this.hideChannelSubscriptions) { - if (subCount >= 1000000) { - this.channelSubscriptionCountText = `${subCount / 1000000}M` - } else if (subCount >= 10000) { - this.channelSubscriptionCountText = `${subCount / 1000}K` + if (subCount >= 10000) { + this.channelSubscriptionCountText = Intl.NumberFormat([this.currentLocale, 'en'], { notation: 'compact' }).format(subCount) } else { - this.channelSubscriptionCountText = Intl.NumberFormat(this.currentLocale).format(subCount) + this.channelSubscriptionCountText = Intl.NumberFormat([this.currentLocale, 'en']).format(subCount) } }