Updated ratios to use devide

This commit is contained in:
2025-09-02 22:00:59 +02:00
parent d3b04eec9a
commit 7008b44a00
5 changed files with 19 additions and 18 deletions

View File

@@ -3,7 +3,7 @@ import { Card, CardContent } from "@/components/ui/card"
import { Separator } from "@/components/ui/separator"
import { formatNumber } from "@/lib/formatters"
import { getAllDivisions, getMostPlayed } from "@/lib/hypixel/duels/duels"
import { romanize } from "@/lib/hypixel/general"
import { devide, romanize } from "@/lib/hypixel/general"
import { NonNullStats } from "@/lib/schema/player"
import CollapsedStats from "../../_components/CollapsedStats"
import DuelsGeneralStats from "./stats"
@@ -12,8 +12,8 @@ import DuelsStatsTable from "./table"
export default function DuelsStats({ stats }: { stats: NonNullStats["Duels"] }) {
if (!stats) return null
const wl = stats.wins / stats.losses
const kd = stats.kills / stats.deaths
const wl = formatNumber(devide(stats.wins, stats.losses))
const kd = formatNumber(devide(stats.kills, stats.deaths))
const div = getAllDivisions(stats)
const mostPlayed = getMostPlayed(stats)
@@ -61,7 +61,7 @@ export default function DuelsStats({ stats }: { stats: NonNullStats["Duels"] })
},
{
title: <p>WL</p>,
stat: <p className="text-muted-foreground">{formatNumber(wl)}</p>
stat: <p className="text-muted-foreground">{wl}</p>
}
]}
/>