fixes progress percentages always floored resulting in 1% open even if there are no open issues

Thu, 15 Oct 2020 11:42:43 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 15 Oct 2020 11:42:43 +0200
changeset 126
4148e6de0f21
parent 125
decc4c3854a1
child 127
6105ee2cceaf

fixes progress percentages always floored resulting in 1% open even if there are no open issues

src/main/java/de/uapcore/lightpit/entities/IssueSummary.java file | annotate | diff | comparison | revisions
--- a/src/main/java/de/uapcore/lightpit/entities/IssueSummary.java	Fri Oct 09 19:14:40 2020 +0200
+++ b/src/main/java/de/uapcore/lightpit/entities/IssueSummary.java	Thu Oct 15 11:42:43 2020 +0200
@@ -39,12 +39,12 @@
 
     public int getActivePercent() {
         int total = getTotal();
-        return total > 0 ? 100*active/total : 0;
+        return total > 0 ? Math.round(100.f*active/total) : 0;
     }
 
     public int getDonePercent() {
         int total = getTotal();
-        return total > 0 ? 100*done/total : 100;
+        return total > 0 ? Math.round(100.f*done/total) : 100;
     }
 
     /**

mercurial