From b2442617151f68fbca7f5cf349fc28b9cd4ca4e3 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 25 May 2020 12:19:15 -0400 Subject: [PATCH] commas --- ui/component/fileViewCount/view.jsx | 4 +++- ui/page/channel/view.jsx | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/component/fileViewCount/view.jsx b/ui/component/fileViewCount/view.jsx index edc4a4725..3e37fd4ec 100644 --- a/ui/component/fileViewCount/view.jsx +++ b/ui/component/fileViewCount/view.jsx @@ -18,9 +18,11 @@ function FileViewCount(props: Props) { } }, [fetchViewCount, uri, claim]); + const formattedViewCount = Number(viewCount).toLocaleString(); + return ( - {viewCount !== 1 ? __('%view_count% Views', { view_count: viewCount }) : __('1 View')} + {viewCount !== 1 ? __('%view_count% Views', { view_count: formattedViewCount }) : __('1 View')} ); diff --git a/ui/page/channel/view.jsx b/ui/page/channel/view.jsx index 037768673..e7dfac69b 100644 --- a/ui/page/channel/view.jsx +++ b/ui/page/channel/view.jsx @@ -90,6 +90,7 @@ function ChannelPage(props: Props) { const [searchResults, setSearchResults] = useState(undefined); const [lastYtSyncDate, setLastYtSyncDate] = useState(); const claimId = claim.claim_id; + const formattedSubCount = Number(subCount).toLocaleString(); // If a user changes tabs, update the url so it stays on the same page if they refresh. // We don't want to use links here because we can't animate the tab change and using links @@ -240,7 +241,7 @@ function ChannelPage(props: Props) {

{title || '@' + channelName}

- {subCount} {subCount !== 1 ? __('Followers') : __('Follower')} + {formattedSubCount} {subCount !== 1 ? __('Followers') : __('Follower')} {channelIsMine && !editing && (