Change to display score unit

This commit is contained in:
ryo-ma 2020-08-28 00:07:50 +09:00
parent 8876ff22fa
commit 819c5ba2b8

View file

@ -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";
} }