Merge pull request #476 from jlmitch5/fixIGPercentage

fix instance group percentage
This commit is contained in:
jlmitch5 2017-09-27 17:11:17 -04:00 committed by GitHub
commit e877651a1e

View File

@ -22,11 +22,14 @@ export default ['templateUrl', 'ComponentsStrings',
scope.$watch('capacity', function() {
if (scope.totalCapacity !== 0) {
var percentageCapacity = Math
.round(scope.capacity / scope.totalCapacity * 10) / 10 * 100;
scope.CapacityStyle = {
'flex-grow': scope.capacity * 0.01
'flex-grow': percentageCapacity * 0.01
};
scope.consumedCapacity = `${scope.capacity}%`;
scope.consumedCapacity = `${percentageCapacity}%`;
} else {
scope.CapacityStyle = {
'flex-grow': 1