I'm possibly writing a lot of terms incorrectly in this question since I'm kinda lost in how to look for this.
The problem I have is, given a monetary value that must be paid (a fee of some sort), and also given that this value comes from multiple sources, and I would like to correclty alocate them. How to correctly do the division. For instance, if I bought itens A, B and C, together they have a fee of $2.45. What I would do is:
fee of A alone = \$A/(\$A + \$B + \$C)*TotalFee
(and so on)
However, rounding the fees to two decimal places, and summing them at the end, sometimes gives a different value than the original fee.
I usually just adjust by hand, but I imagine there is a correct way to adjust that, possibly using the remaiders of division.
Thank you!