Switched to formatnumber func

This commit is contained in:
2025-09-01 12:21:58 +02:00
parent 32b4f2cebc
commit d58856ccd1
7 changed files with 72 additions and 62 deletions

View File

@@ -3,6 +3,7 @@
import { AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion"
import { Card, CardContent } from "@/components/ui/card"
import { Separator } from "@/components/ui/separator"
import { formatNumber } from "@/lib/formatters"
import { getBWLevelForExp, getTotalExpForLevel } from "@/lib/hypixel/bedwars/level"
import { getProgress } from "@/lib/hypixel/general"
import { NonNullStats } from "@/lib/schema/player"
@@ -14,10 +15,10 @@ import BedwarsStatTable from "./table"
export default function BedwarsStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
if (!stats) return null
const kd = (stats.kills_bedwars / stats.deaths_bedwars).toFixed(2)
const fkd = (stats.final_kills_bedwars / stats.final_deaths_bedwars).toFixed(2)
const wl = (stats.wins_bedwars / stats.losses_bedwars).toFixed(2)
const bbl = (stats.beds_broken_bedwars / stats.beds_lost_bedwars).toFixed(2)
const kd = formatNumber(stats.kills_bedwars / stats.deaths_bedwars)
const fkd = formatNumber(stats.final_kills_bedwars / stats.final_deaths_bedwars)
const wl = formatNumber(stats.wins_bedwars / stats.losses_bedwars)
const bbl = formatNumber(stats.beds_broken_bedwars / stats.beds_lost_bedwars)
const level = getBWLevelForExp(stats.Experience)
const current = getTotalExpForLevel(level)