Skip to content

Commit

Permalink
Made unit calculation much more simple
Browse files Browse the repository at this point in the history
  • Loading branch information
0spooky committed Oct 5, 2018
1 parent 7d8f8ea commit 0b4cdf6
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions imports/ui/ranking/Ranking.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,9 @@ Template.Ranking.events({
});

function getStatisticUnit(statistic) {
let returnString = "";
switch (statistic) {
case "handWinRate":
case "dealinRate":
case "flyRate":
case "riichiRate":
case "riichiWinRate":
returnString = " %";
break;
default:
break;
}
return returnString;
return ["handWinRate",
"dealinRate",
"flyRate",
"riichiRate",
"riichiWinRate"].includes(statistic) ? " %" : "";
}

0 comments on commit 0b4cdf6

Please sign in to comment.