fix(hermes): Dividing the percentage by 100 produces the expected multiplier: 10% off 100.0 becomes 90.0, 100% becomes 0.0, and 15% off 19.99 rounds to 16.99. (incident hermes-code-demo/13)
This commit is contained in:
parent
0fd6ea129c
commit
b3d3aa2fca
@ -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