Comment by MostlyStable
10 hours ago
I don't see why you couldn't do it in either case. If you modify the actual price, then you are giving exact change. Why wouldn't round() be as valid a price modification as floor()?
10 hours ago
I don't see why you couldn't do it in either case. If you modify the actual price, then you are giving exact change. Why wouldn't round() be as valid a price modification as floor()?
Presumably "increase the price a small amount to avoid giving exact change" is exactly the sort of thing that laws requiring giving exact change were designed to prevent.
There will surely be some customer pissed about the extra 2 cents they were charged who will raise hell over the exact change law.
But what customer is going to be upset over a small discount?
Maybe sales tax makes that harder?
I guess you could calculate all of your prices such that, once sales tax is added, they round to a 5 cent value.
You don't need to do that. Compute the total sale, then figure the tax, then round. You don't need to round per item.