From d1cb87778467200461596c618aea0e739a0ace40 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Tue, 14 Feb 2023 16:28:32 -0500 Subject: [PATCH] Format views for billions --- playlet-lib/src/components/VideoRowCell/VideoRowCell.bs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/playlet-lib/src/components/VideoRowCell/VideoRowCell.bs b/playlet-lib/src/components/VideoRowCell/VideoRowCell.bs index b994e288..f20dee61 100644 --- a/playlet-lib/src/components/VideoRowCell/VideoRowCell.bs +++ b/playlet-lib/src/components/VideoRowCell/VideoRowCell.bs @@ -87,7 +87,12 @@ function FormatViewCount(viewCount as dynamic) as string end if viewCount = viewCount / 1000 - return `${FormatFloat(viewCount)}M views` + if viewCount < 1000 + return `${FormatFloat(viewCount)}M views` + end if + + viewCount = viewCount / 1000 + return `${FormatFloat(viewCount)}B views` end function function FormatFloat(X as integer) as integer