mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Bug 13059: cast the long to float else the fraction would be 0 - java basics :).
Reviewed-By: Kishan
This commit is contained in:
parent
74ce678baf
commit
560d54a49c
@ -2018,7 +2018,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||||||
for (DataCenterVO dc : dcList) {
|
for (DataCenterVO dc : dcList) {
|
||||||
CapacityVO capacity = _storageMgr.getSecondaryStorageUsedStats(null, dc.getId());
|
CapacityVO capacity = _storageMgr.getSecondaryStorageUsedStats(null, dc.getId());
|
||||||
if (capacity.getTotalCapacity() != 0) {
|
if (capacity.getTotalCapacity() != 0) {
|
||||||
capacity.setUsedPercentage(capacity.getUsedCapacity() / capacity.getTotalCapacity());
|
capacity.setUsedPercentage((float)capacity.getUsedCapacity() / capacity.getTotalCapacity());
|
||||||
} else {
|
} else {
|
||||||
capacity.setUsedPercentage(0);
|
capacity.setUsedPercentage(0);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user