Skip to content

Commit

Permalink
issue-328 round cost savings to 0 decimal
Browse files Browse the repository at this point in the history
  • Loading branch information
RLiNREL committed Nov 26, 2024
1 parent 27d752c commit 56179ae
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 56179ae

Please sign in to comment.