fix(hermes): A percentage must be divided by 100 before subtracting it from 1. This one-line change produces the expected 90.0, 0.0, and 16.99 results without changing validation or rounding behavior. (incident hermes-code-demo/4)
This commit is contained in:
parent
50416b5064
commit
c740dfe9aa
@ -10,4 +10,4 @@ def apply_discount(subtotal: float, percent: float) -> float:
|
|||||||
|
|
||||||
if percent < 0 or percent > 100:
|
if percent < 0 or percent > 100:
|
||||||
raise ValueError("percent must be between 0 and 100")
|
raise ValueError("percent must be between 0 and 100")
|
||||||
return round(subtotal * (1 - percent / 10), 2)
|
return round(subtotal * (1 - percent / 100), 2)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user