From 0ba447ddf71e59c64e6f9404f10a179293af3fbb Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Tue, 31 Jul 2018 10:19:58 +0300 Subject: [PATCH] Fixed retain percentage calculation on health tab #652 --- .../plan/data/store/mutators/health/HealthInformation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/data/store/mutators/health/HealthInformation.java b/Plan/src/main/java/com/djrapitops/plan/data/store/mutators/health/HealthInformation.java index 3e17c0a33..fb7c22306 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/store/mutators/health/HealthInformation.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/store/mutators/health/HealthInformation.java @@ -77,13 +77,13 @@ public class HealthInformation extends AbstractHealthInfo { long playersRetainedMonth = analysisContainer.getValue(AnalysisKeys.PLAYERS_RETAINED_MONTH).orElse(0); if (playersNewMonth != 0) { - double retainPercentage = playersRetainedMonth / playersNewMonth; + double retainPercentage = playersRetainedMonth * 1.0 / playersNewMonth; if (retainPercentage >= 0.25) { addNote(Icons.GREEN_THUMB + " " + Formatters.percentage().apply(retainPercentage) + " of new players have stuck around (" + playersRetainedMonth + "/" + playersNewMonth + ")"); } else { addNote(Icons.YELLOW_FLAG + " " + Formatters.percentage().apply(retainPercentage) - + "% of new players have stuck around (" + playersRetainedMonth + "/" + playersNewMonth + ")"); + + " of new players have stuck around (" + playersRetainedMonth + "/" + playersNewMonth + ")"); } } }