fix(hermes): A percentage is expressed per hundred. Dividing by 100 produces 90.0 for 10%, 0.0 for 100%, and 16.99 for 15% of 19.99 while preserving existing validation and rounding. (incident hermes-code-demo/10)
This commit is contained in:
parent
92fae0a1c4
commit
3a50995dc9
@ -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