title: Javascript. Calculating a percentage results in 1% difference
body: <p>I'm having an issue with some javascript where I am calculating a percentage. It always comes in 1% off:</p>
  
  <pre><code>pcOff = parseInt((1-(PriceFrom/PriceFromRRP))*100);
  </code></pre>
  
  <p>PriceFrom and PriceFromRRP are captured from a JSON return and in the case of <code>PriceFrom = '40.00'</code> and <code>PriceFromRRP = '50.00'</code> pcOff is being set to 19; it should be of 20. Something funny is going on here. Can anyone shed some light?</p>