7 lines
222 B
TypeScript
7 lines
222 B
TypeScript
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);
|
|
}
|
|
} |