Background: I have a backend system that only accepts prices at an 'each' level with 2 decimal places. IOW you can send a price of 2.99 into the system for an order. But we want to offer dollar off discounts (i.e. $10 off when you spend over 100). So since we can only send a price each (we can't send in total amount at the line item or order level), we need to pro-rate the discount on each line item.
So for example:
item A = (10.26 each x qty of 12) = 123.12 - 10.00 discount = 113.12. 113.12 / 12 = 9.42666666 (we need to get this into a price each with 2 decimals and since we can't over charge customers we round down). So now we have 12 x 9.42 going into the system which is 113.04 and so we just lost 8 cents. Before I hack around this by using something like an adjust item with a price of -8 cents.. is there a proper way to mathematically making this work?