Skip to content

Issue 169: fix payback calculation so it isn't negative#173

Merged
RLiNREL merged 1 commit intodevelopfrom
issue-169-payback-calc
Dec 17, 2025
Merged

Issue 169: fix payback calculation so it isn't negative#173
RLiNREL merged 1 commit intodevelopfrom
issue-169-payback-calc

Conversation

@rmroot
Copy link
Copy Markdown
Member

@rmroot rmroot commented Dec 17, 2025

connects #169

This pull request improves the robustness of payback calculations across several report generation functions by ensuring that invalid payback values (such as negative numbers or NaN) are set to zero, in addition to handling Infinity as before. This prevents misleading or erroneous payback results from appearing in reports.

Improvements to payback calculation validation:

  • Updated payback calculations in getAssessmentReport (assessmentReport.ts) to set payback to zero if the result is Infinity, NaN, or negative. [1] [2]
  • Applied the same validation logic to payback calculations in getEnergyOpportunityReport (energyOpportunityReport.ts).
  • Enhanced payback validation in getExecutiveSummaryReport (executiveSummaryReport.ts) to include checks for negative and NaN values.
  • Updated the ExecutiveSummaryProjectSummaryComponent to ensure payback values are set to zero if they are Infinity, negative, or NaN.

@rmroot rmroot requested a review from RLiNREL December 17, 2025 14:05
@RLiNREL RLiNREL merged commit e2dcb5f into develop Dec 17, 2025
1 check passed
@RLiNREL RLiNREL deleted the issue-169-payback-calc branch December 17, 2025 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants