Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Handle division by zero in growth calculation #3047

Merged
merged 1 commit into from
Aug 21, 2024
Merged

fix: Handle division by zero in growth calculation #3047

merged 1 commit into from
Aug 21, 2024

Conversation

TheDancingClown
Copy link
Contributor

📝 A short description of the changes

  • This commit modifies the FinancialTableSummary module to handle division by zero in the growth calculation. Previously, if the previous value was zero, the calculation would result in an error. Now, if the previous value is zero, the growth percentage is set to "-" to indicate no growth. This prevents the division by zero error and ensures accurate growth calculations.

🔗 Link to the relevant story (or stories)

:shipit: Deployment implications

  • None

✅ Checklist

  • Features that cannot go live are behind a feature flag/env var or specify deploy date and open PR as draft
  • I have checked that commit messages make sense and explain the reasoning for each change
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have squashed any unnecessary or part-finished commits

This commit modifies the `FinancialTableSummary` module to handle division by zero in the growth calculation. Previously, if the previous value was zero, the calculation would result in an error. Now, if the previous value is zero, the growth percentage is set to "-" to indicate no growth. This prevents the division by zero error and ensures accurate growth calculations.

```

Signed-off-by: Louis Kirkham <[email protected]>
@matthewford matthewford merged commit 8312750 into main Aug 21, 2024
12 checks passed
@matthewford matthewford deleted the round branch August 21, 2024 15:38
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