fix(hermes): Percent values must be converted from a whole-number percentage to a fractional multiplier by dividing by 100. (incident hermes-code-demo/6)
This commit is contained in:
parent
2cf11aa9ae
commit
424150bf85
@ -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