From 56179ae6bc77387114e082d0e0f0bddc67b43b2f Mon Sep 17 00:00:00 2001 From: Roy Date: Tue, 26 Nov 2024 12:17:38 -0700 Subject: [PATCH] issue-328 round cost savings to 0 decimal --- .../energy-opportunity-setup-form.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/shared/shared-assessment-forms/energy-opportunity-setup-form/energy-opportunity-setup-form.component.ts b/src/app/shared/shared-assessment-forms/energy-opportunity-setup-form/energy-opportunity-setup-form.component.ts index 35e6c4a6..f5aee49b 100644 --- a/src/app/shared/shared-assessment-forms/energy-opportunity-setup-form/energy-opportunity-setup-form.component.ts +++ b/src/app/shared/shared-assessment-forms/energy-opportunity-setup-form/energy-opportunity-setup-form.component.ts @@ -122,10 +122,11 @@ export class EnergyOpportunitySetupFormComponent { let trimmedType = this.energyOpportunity.utilityType.replace(/\s+/g, ''); let camelCaseType = trimmedType.charAt(0).toLowerCase() + trimmedType.slice(1); if (this.facilityUnitSettings[`include${trimmedType}`]) { - this.energyOpportunity.costSavings = this.convertValue.convertValue( + let costSavings = this.convertValue.convertValue( this.energyOpportunity.energySavings * this.facilityUnitSettings[`${camelCaseType}Price`], this.energyOpportunity.energyUnit, this.facilityUnitSettings[`${camelCaseType}Unit`]).convertedValue; + this.energyOpportunity.costSavings = parseFloat(costSavings.toFixed(0)); } await this.saveEnergyOpportunity(); }