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?