mirror of
https://github.com/reiyua/github-profile-trophy-reiyua-mirror.git
synced 2026-11-17 06:02:09 +11:00
Change to display score unit
This commit is contained in:
parent
8876ff22fa
commit
819c5ba2b8
1 changed files with 2 additions and 5 deletions
|
|
@ -12,14 +12,11 @@ export function abridgeScore(score: number): string {
|
||||||
if (Math.abs(score) < 1) {
|
if (Math.abs(score) < 1) {
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
if (Math.abs(score) < 10) {
|
|
||||||
return score.toString() + "+"
|
|
||||||
}
|
|
||||||
if (Math.abs(score) > 999){
|
if (Math.abs(score) > 999){
|
||||||
return (Math.sign(score) * (Math.abs(score) / 1000)).toFixed(1) + "k+"
|
return (Math.sign(score) * (Math.abs(score) / 1000)).toFixed(1) + "pt"
|
||||||
|
|
||||||
}
|
}
|
||||||
return (Math.sign(score) * Math.abs(score)).toString().slice(0, -1) + "0+";
|
return (Math.sign(score) * Math.abs(score)).toString() + "pt";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue