Tariffs: add tax only on positive prices (#14527)
This commit is contained in:
parent
22540409c1
commit
0a42b53b2d
1 changed files with 5 additions and 1 deletions
|
|
@ -6,5 +6,9 @@ type embed struct {
|
|||
}
|
||||
|
||||
func (t *embed) totalPrice(price float64) float64 {
|
||||
return (price + t.Charges) * (1 + t.Tax)
|
||||
total := price + t.Charges
|
||||
if total > 0 {
|
||||
total *= 1 + t.Tax
|
||||
}
|
||||
return total
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue