website refactor
This commit is contained in:
7
apps/website/lib/display-objects/WinRateDisplay.ts
Normal file
7
apps/website/lib/display-objects/WinRateDisplay.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export class WinRateDisplay {
|
||||
static calculate(racesCompleted: number, wins: number): string {
|
||||
if (racesCompleted === 0) return '0.0';
|
||||
const rate = (wins / racesCompleted) * 100;
|
||||
return rate.toFixed(1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user