title: How to convert between Profit Margin % and Markup %
body: <p>I am writing a code where I need to convert between the profit margin % to the markup % </p>
  
  <p>For example if I type 50% Profit Margin then the Markup % should be 100%. If I type 75% profit Margin then the markup % will = 300%.</p>
  
  <p>I found this link that gives the formulas
  <a href="http://larig.wordpress.com/2010/07/06/convert-between-margin-and-mark-up/" rel="nofollow noreferrer">http://larig.wordpress.com/2010/07/06/convert-between-margin-and-mark-up/</a></p>
  
  <pre><code>|margin| = 1 - 1 / (1 + |markup|)
  |markup| = 1 / (1 - |margin|) - 1
  </code></pre>
  
  <p>when I tried to apply the formula I do not get the desired results. (This formula did not make since and it is not calculating correctly.)</p>
  
  <p>Here is what I have done using C#</p>
  
  <pre><code>InputMarkup.Text = Math.Abs((1 / (1 - Math.Abs(margin) - 1))).ToString();
  </code></pre>
  
  <p>I also tried this</p>
  
  <pre><code>InputMarkup.Text = Math.Abs((1 / (1 - Math.Abs(margin))) - 1).ToString()
  </code></pre>