shwstppr commented on code in PR #11302:
URL: https://github.com/apache/cloudstack/pull/11302#discussion_r2236185023


##########
server/src/main/java/com/cloud/api/query/dao/HostJoinDaoImpl.java:
##########
@@ -401,6 +400,9 @@ public List<HostJoinVO> findByClusterId(Long clusterId, 
Host.Type type) {
     }
 
     private String calculateResourceAllocatedPercentage(float resource, float 
resourceWithOverProvision) {
+        if (resource == 0 || resourceWithOverProvision == 0) {
+            return "0.00%";
+        }
         DecimalFormat decimalFormat = new DecimalFormat("#.##");
         return decimalFormat.format(((float)resource / 
resourceWithOverProvision * 100.0f)) + "%";

Review Comment:
   Can be a separate PR/change as not touched here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to