Hacker News new | ask | show | jobs
by genezeta 569 days ago
Slow down :)

- In one case you write (p/100) and in the other (totalDiscount/100). It wouldn't matter because the end result is the same mathematically, but the apparent meaning is different. But anyway...

- Now the calculated total price is 30, but it should be 70. totalPrice = basePrice * (1 - totalDiscount/100)