🐛 Round user count to the nearest 10k

This commit is contained in:
Luke Vella 2025-03-28 10:43:44 +00:00
parent f05f437b56
commit 26b4afeada
No known key found for this signature in database
GPG key ID: 469CAD687F0D784C

View file

@ -12,6 +12,8 @@ import { BonusItem } from "@/components/home/bonus-item";
export async function Bonus({ t }: { t: TFunction<"home" | "common"> }) {
const userCount = await prisma.user.count();
const roundedUserCount =
userCount > 100000 ? Math.floor(userCount / 10000) * 10000 : userCount;
return (
<div className="mx-auto flex flex-wrap justify-center gap-2 whitespace-nowrap text-center sm:grid-cols-4 sm:gap-4 sm:gap-x-8">
<BonusItem
@ -23,7 +25,7 @@ export async function Bonus({ t }: { t: TFunction<"home" | "common"> }) {
i18nKey="statsUsersRegistered"
ns="home"
defaults="{count, number, ::compact-short} registered users"
values={{ count: userCount }}
values={{ count: roundedUserCount }}
/>
</BonusItem>
<BonusItem