fix: Corrected percentage calculation

This commit is contained in:
TheOptimisticFactory 2020-04-27 01:52:21 +02:00
parent aaba3292f0
commit c08e59477d

View file

@ -329,7 +329,7 @@ public class LGVote {
int votesNbr = votes.get(voted).size();
final int numberOfParticipants = participants.size();
final double votePercentage = (double) (votesNbr / numberOfParticipants) * 100;
final double votePercentage = ((double)votesNbr / numberOfParticipants) * 100;
final String votePercentageFormated = String.format("%.0f%%", votePercentage);
final String voteContent = "§6§l" + votesNbr + " / " + numberOfParticipants + "§e vote" + (votesNbr > 1 ? "s" : "") + " (§6§l" + votePercentageFormated + "§e)";