Skip to content

Fix tax calculation threshold and improve discount calculation logic#10

Open
henryhabib wants to merge 1 commit into
masterfrom
hh-cat-20260224-v2
Open

Fix tax calculation threshold and improve discount calculation logic#10
henryhabib wants to merge 1 commit into
masterfrom
hh-cat-20260224-v2

Conversation

@henryhabib
Copy link
Copy Markdown
Owner

This pull request updates the tax calculation logic and refines the discount calculation method in app.py. The main changes are focused on improving the accuracy of both tax and discount computations.

Tax calculation logic:

  • Adjusted the lowest tax bracket threshold in calculate_tax to apply the 10% rate to incomes up to 5,000 instead of 10,000.

Discount calculation logic:

  • Modified calculate_discount to iteratively apply a 1% reduction for each percentage point of the discount rate, instead of simply multiplying by the discount rate divided by 100. This results in a more accurate calculation for larger discount rates.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modifies tax and discount calculation logic in a Flask-based personal finance tracker application. The changes aim to adjust the tax bracket threshold and implement what is described as a "more accurate" discount calculation method.

Changes:

  • Modified the lowest tax bracket threshold from 10,000 to 5,000 in the calculate_tax function
  • Replaced the simple discount calculation with an iterative approach that applies 1% reductions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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