Bug 13059: cast the long to float else the fraction would be 0 - java basics :).

Reviewed-By: Kishan
This commit is contained in:
Nitin Mehta 2012-02-17 15:06:56 +05:30
parent 74ce678baf
commit 560d54a49c

View File

@ -2018,7 +2018,7 @@ public class ManagementServerImpl implements ManagementServer {
for (DataCenterVO dc : dcList) {
CapacityVO capacity = _storageMgr.getSecondaryStorageUsedStats(null, dc.getId());
if (capacity.getTotalCapacity() != 0) {
capacity.setUsedPercentage(capacity.getUsedCapacity() / capacity.getTotalCapacity());
capacity.setUsedPercentage((float)capacity.getUsedCapacity() / capacity.getTotalCapacity());
} else {
capacity.setUsedPercentage(0);
}