What's the best way to split the decimal prices and quantities to a whole number representation?
E.g.
100 Banana at $\6.3 each, and the seller doesn't accept cents.
I am splitting this using following logic:
Take 6 and immediate next number (7) as prices. So 6Q_1 + 7Q_2 = 630 ~~\text{ and }~~ Q_1+Q_2=100\cdots$ Solving this gives me $Q_1=70$ at $\$6 each and $Q_2=30$ at $\$$7 each.
Is there a better mathematical model to solve this splitting problem accurately for any decimal and quantity?