Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can't figure out this formula; I need some help to write it out for a php script.

I have a value of $\$80$.

$\$80$ is the profit from a total sale of $\$100$; $ 20\%$ is the percentage margin for the respective product.

Now I just have the $\$80$ and want to get the total figure of $\$100$. How can I get the total figure and what would be the formula?

Your help is much appreciated. Thanks in advance.

share|cite|improve this question
up vote 3 down vote accepted

If you mean that you get $80$ from $100$ after a $20$ per cent discount and want to reverse the process, multiply by $\frac{100}{100-20}=\frac{5}{4}$. The formula you need is $y=\frac{5x}{4}$, so if $x=80$, then $y=100$.

share|cite|improve this answer
Awesome, you just solved and made my day, thank you so much. It worked perfectly. – sammry Nov 20 '12 at 22:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.