Skip to content

fix(business): apply percentage discount mathematically#48

Open
emre155 wants to merge 1 commit into
marandaneto:mainfrom
emre155:fix/discount-percentage-calculation-issue-25
Open

fix(business): apply percentage discount mathematically#48
emre155 wants to merge 1 commit into
marandaneto:mainfrom
emre155:fix/discount-percentage-calculation-issue-25

Conversation

@emre155

@emre155 emre155 commented Jul 18, 2026

Copy link
Copy Markdown

Summary

Fixes the discount calculation where percentage values were being subtracted directly as a flat currency amount (closes #25).

Changes

  • Modified calculateDiscountedPrice in src/business.js to compute the discount as price * (1 - discountPercent / 100) instead of price - discountPercent.

All related tests now pass cleanly.

Signed-off-by: emreumar emreumar@users.noreply.github.com

Updates calculateDiscountedPrice to compute percentage discount correctly
as 'price * (1 - discountPercent / 100)' instead of treating the percent value
as a flat currency amount and subtracting it directly.

Closes marandaneto#25

Signed-off-by: emreumar <emreumar@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 18, 2026 10:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Discount API subtracts the percent value directly

3 participants