From c08e59477df528354445ec061a5e4933989bb319 Mon Sep 17 00:00:00 2001 From: TheOptimisticFactory Date: Mon, 27 Apr 2020 01:52:21 +0200 Subject: [PATCH] fix: Corrected percentage calculation --- src/main/java/fr/leomelki/loupgarou/classes/LGVote.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/fr/leomelki/loupgarou/classes/LGVote.java b/src/main/java/fr/leomelki/loupgarou/classes/LGVote.java index 7bf3982..c354c4a 100644 --- a/src/main/java/fr/leomelki/loupgarou/classes/LGVote.java +++ b/src/main/java/fr/leomelki/loupgarou/classes/LGVote.java @@ -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)";