I have been trying to google this for hours but am finding it hard to find the maths to achieve this.
If the total payment is 200 GBP and the user has paid 100 GBP - he has paid 50% of the total.
I am trying to translate this to an algorithm but cannot get the expected result.
I have tried:
($total / $paid) * 100;
(($total + $paid) / 100) * 2;
($total - $paid) / 100;
But neither of this is giving me 50% when I use 200 as the total payment and 100 as the amount paid. Any help would be appreciated. I'm not very good at maths.