Apologies in advance if I have not formatted this problem correctly.
Context: I need to find a way to calculate a number that will equal a service fee applied to a product, taking into account the service fee will also be applied to this number.
The system is sort of a middle man between a client and supplier. Currently the the supplier takes the cost of the service charge. We need to be able to allow the client to take this charge. And to do that it it needs to be added as a line item on the invoice, the problem is the service charge will be applied to the line item also as it is calculated using the total transaction value. So in the case above a £2 line item could be added to offset the original service charge, but the 2% would also be applied leaving that (£0.04) unaccounted for.
Example: The cost of a product is £100, the an service fee would be (2%) £2.
In this case the number couldn't be £2 because a 2% fee would also be applied to the £2 leaving £0.04.
When I first looked at this problem I originally thought the value could be:
((Cost of Product) * 0.02) + ((Cost of Product) * 0.02) * 0.02)
But this is wrong also as there is still a small amount remaining.
Is there an easy way to calculate what the value should be?