diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/SubscriptionManagerImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/SubscriptionManagerImpl.java index 81c3f2d680..a55ea7126f 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/SubscriptionManagerImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/SubscriptionManagerImpl.java @@ -1851,7 +1851,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager { Map statusPercentages = new HashMap<>(); for (Map.Entry entry : statusCounts.entrySet()) { double percentage = ((double) entry.getValue() / totalDevices) * 100; - statusPercentages.put(entry.getKey(), percentage); + String formattedPercentage = String.format("%.2f", percentage); + statusPercentages.put(entry.getKey(), Double.valueOf(formattedPercentage)); } CategorizedSubscriptionResult categorizedSubscriptionResult; @@ -2033,7 +2034,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager { Map statusPercentages = new HashMap<>(); for (Map.Entry entry : statusCounts.entrySet()) { double percentage = ((double) entry.getValue() / totalDevices) * 100; - statusPercentages.put(entry.getKey(), percentage); + String formattedPercentage = String.format("%.2f", percentage); + statusPercentages.put(entry.getKey(), Double.valueOf(formattedPercentage)); } CategorizedSubscriptionResult categorizedSubscriptionResult; @@ -2225,7 +2227,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager { Map statusPercentages = new HashMap<>(); for (Map.Entry entry : statusCounts.entrySet()) { double percentage = totalDevices == 0 ? 0.0 : ((double) entry.getValue() / totalDevices) * 100; - statusPercentages.put(entry.getKey(), percentage); + String formattedPercentage = String.format("%.2f", percentage); + statusPercentages.put(entry.getKey(), Double.valueOf(formattedPercentage)); } CategorizedSubscriptionResult categorizedSubscriptionResult; @@ -2417,7 +2420,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager { Map statusPercentages = new HashMap<>(); for (Map.Entry entry : statusCounts.entrySet()) { double percentage = ((double) entry.getValue() / totalDevices) * 100; - statusPercentages.put(entry.getKey(), percentage); + String formattedPercentage = String.format("%.2f", percentage); + statusPercentages.put(entry.getKey(), Double.valueOf(formattedPercentage)); } CategorizedSubscriptionResult categorizedSubscriptionResult; @@ -2552,7 +2556,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager { Map statusPercentages = new HashMap<>(); for (Map.Entry entry : statusCounts.entrySet()) { double percentage = ((double) entry.getValue() / totalDevices) * 100; - statusPercentages.put(entry.getKey(), percentage); + String formattedPercentage = String.format("%.2f", percentage); + statusPercentages.put(entry.getKey(), Double.valueOf(formattedPercentage)); } CategorizedSubscriptionResult categorizedSubscriptionResult =