From 99bef6f84c4889908d7e3f5ffc22b16fd0e52a9d Mon Sep 17 00:00:00 2001 From: Chad Kruse <314653+chadokruse@users.noreply.github.com> Date: Sat, 7 Dec 2024 10:09:04 -0600 Subject: [PATCH] Fix percentile calcs --- .../src/lib/components/profiles/ranking/PercentileBar.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/lib/components/profiles/ranking/PercentileBar.svelte b/apps/web/src/lib/components/profiles/ranking/PercentileBar.svelte index 69d866e..4600170 100644 --- a/apps/web/src/lib/components/profiles/ranking/PercentileBar.svelte +++ b/apps/web/src/lib/components/profiles/ranking/PercentileBar.svelte @@ -13,8 +13,8 @@ const getLabel = (pct: number | 'N/A') => { if (pct === 'N/A') return 'N/A'; if (pct <= 50) return '<50% Percentile'; - if (pct > 99) return 'Top 1%'; - return `Top ${(100 - pct).toFixed(0)}%`; + if (pct >= 99) return 'Top 1%'; + return `Top ${Math.ceil(100 - pct)}%`; }; let getBarColor = (pct: number | 'N/A') => {