feat: core chunk 4

This commit is contained in:
TrèsAbhi committed 2023-10-14 11:15:42 -05:00
1 parent b827f7f730
commit 9bdb14e13a
22 files changed
+46 -31

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
import { Percentile } from '../../constants/percentiles';
export const WN8_PERCENTILES: [number, Percentile][] = [
[0, Percentile.VeryBad],
[300, Percentile.Bad],
[450, Percentile.BelowAverage],
[650, Percentile.Average],
[900, Percentile.AboveAverage],
[1200, Percentile.Good],
[1600, Percentile.VeryGood],
[2000, Percentile.Great],
[2450, Percentile.Unicum],
[2900, Percentile.SuperUnicum],
];
export default function getWN8Percentile(WN8: number) {
const lastIndex = WN8_PERCENTILES.findLastIndex(
([WN8Listing]) => WN8Listing <= WN8,
);
return WN8_PERCENTILES[lastIndex === -1 ? 0 : lastIndex][1];
}