diff --git a/force-app/main/default/classes/Scoring.cls b/force-app/main/default/classes/Scoring.cls index 19b5cd56..83dc601c 100644 --- a/force-app/main/default/classes/Scoring.cls +++ b/force-app/main/default/classes/Scoring.cls @@ -92,9 +92,11 @@ public with sharing class Scoring { indicator.IndicatorType = metricIterator.Label; // base percentile * this metric's share of the total weight indicator.IndicatorValue = string.valueOf(serviceValue); - indicator.IndicatorPercentile = + indicator.IndicatorPercentile = Math.round( ((serviceValue - metricIterator.Org_Minimum__c) / spread) * - (metricIterator.Weighting__c / weightTotal); + (metricIterator.Weighting__c / weightTotal) * + 100 + ); Rec.Indicators.add(indicator); Rec.Relevance = Rec.Relevance + indicator.IndicatorPercentile; } diff --git a/force-app/main/default/lwc/serviceRecommendations/serviceRecommendations.js b/force-app/main/default/lwc/serviceRecommendations/serviceRecommendations.js index 7402dccd..b570df79 100644 --- a/force-app/main/default/lwc/serviceRecommendations/serviceRecommendations.js +++ b/force-app/main/default/lwc/serviceRecommendations/serviceRecommendations.js @@ -60,7 +60,7 @@ export default class ServiceRecommendations extends LightningElement { if (this.showRecommendations === false) { this.showRecommendations = !this.showRecommendations; } - window.console.log('result' + JSON.stringify(result)); + console.log('result', JSON.parse(JSON.stringify(result))); this.returnRecommendations = result; }) .catch((error) => {