feat: percentile indicator

This commit is contained in:
TresAbhi committed 2023-06-01 19:16:29 +00:00
1 parent 1d04513bb1
commit de857e7263
10 files changed
+112 -8

No files matched your search

+8 -1
View File
@@ -1,3 +1,4 @@
import getWN8Percentile from '../core/blitz/getWN8Percentile.js';
import { AllStats, SupplementaryStats } from '../types/accountInfo.js';
import GenericStats from './GenericStats/index.js';
@@ -14,7 +15,13 @@ export default function GenericAllStats({
<GenericStats
stats={[
['Winrate', `${(100 * (stats.wins / stats.battles)).toFixed(2)}%`],
['WN8', supplementaryStats?.wn8.toFixed(0) ?? -Infinity],
[
'WN8',
supplementaryStats?.WN8.toFixed(0) ?? -Infinity,
supplementaryStats
? getWN8Percentile(supplementaryStats.WN8)
: undefined,
],
[
'Survival',
`${(100 * (stats.survived_battles / stats.battles)).toFixed(2)}%`,