From f5a3e30f960b157f0f8ba3b01b6585ce2fe24123 Mon Sep 17 00:00:00 2001 From: DyepLucban Date: Wed, 28 Aug 2024 15:09:57 +0800 Subject: [PATCH] refactor: Parsed lilybit to hundreds and millions --- apps/info-dashboard/src/app/leaderboard/page.tsx | 6 ++---- apps/info-dashboard/src/lib/fetchers/leaderboard.ts | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/info-dashboard/src/app/leaderboard/page.tsx b/apps/info-dashboard/src/app/leaderboard/page.tsx index 88ccf0b..566d66e 100644 --- a/apps/info-dashboard/src/app/leaderboard/page.tsx +++ b/apps/info-dashboard/src/app/leaderboard/page.tsx @@ -180,12 +180,10 @@ export default function Leaderboard() { leaderboardData ? leaderboardData.reduce( (total, node) => - +node.Points + - total, - 0 + +node.Points +total, 0 ) : 0 - )} + ).toLocaleString()} {/* Todo add api week total Lilybit_rewards earned */} diff --git a/apps/info-dashboard/src/lib/fetchers/leaderboard.ts b/apps/info-dashboard/src/lib/fetchers/leaderboard.ts index dab5fbf..f6259ab 100644 --- a/apps/info-dashboard/src/lib/fetchers/leaderboard.ts +++ b/apps/info-dashboard/src/lib/fetchers/leaderboard.ts @@ -65,7 +65,7 @@ export function toTableData({ } as const); return result; })(), - "Reward Points": Math.round(+Points * 100) / 100, + "Reward Points": (Math.round(+Points * 100) / 100).toLocaleString(), Status: (() => { const online = nodesData.find(