title: Finding the discounted net price in javascript
body: <p></p>
  
  <pre><code>  rate:&lt;input type="text" name="rate" id="rate" /&gt;&lt;br/&gt;
    discount:&lt;input type="text" name="dis" id="dis" /&gt;&lt;br/&gt;
    net:&lt;input type="text" name="net" id="net" onClick="sum()"/&gt;
      &lt;/body&gt;
  </code></pre>
  
  <p>Here are my three fields named rate,discount and net...Now I am trying that when I enter rate and discount so discount should be deducted from the rate and the price left comes on net textbox. </p>
  
  <pre><code>      &lt;script type="text/javascript"&gt;
    function sum()
                    {
        a=Number(document.getElementById("rate").value);  
    b=Number(document.getElementById("dis").value);
  
      c=Number(a-b/100);
       document.getElementById("net").value=c;    
  
       }
  
  
  
     &lt;/script&gt;
  </code></pre>
  
  <p>Here is my javascript code.....when I am entering rate=120 and discount=10 so net amount should be 108 but it is showing net=119.9  which is wrong...could anyone help me out</p>