mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-04 13:01:10 +08:00
showing top % with 2 decimal places
This commit is contained in:
parent
3074004c6c
commit
d8de31409a
1 changed files with 7 additions and 2 deletions
|
@ -96,9 +96,14 @@ function updateFooter(lb) {
|
|||
`);
|
||||
let toppercent;
|
||||
if (currentRank[lb]) {
|
||||
toppercent = `Top ${Math.round(
|
||||
let num = Misc.roundTo2(
|
||||
(currentRank[lb].rank / currentRank[lb].count) * 100
|
||||
)}%`;
|
||||
);
|
||||
if (num == 0) {
|
||||
num = 0.01;
|
||||
}
|
||||
|
||||
toppercent = `Top ${num}%`;
|
||||
}
|
||||
if (currentRank[lb]) {
|
||||
let entry = currentRank[lb];
|
||||
|
|
Loading…
Reference in a new issue