title: Jquery number format
body: <p>I have a script like this, for shipping options</p>
  
  <pre><code>&lt;script language="javascript"&gt;
  $(document).ready(function()
  {   
      var total = 0;
      function calcTotal()
      {
          $("input:checked").each(function()
          {
              //This happens for each checked input field
              var value = $(this).attr("value");
              total += parseInt(value);           
  
          });
      }
      //This happens when the page loads
      calcTotal();    
      $("#total").append('&lt;input style="border:0px" type="text" name="total" value=" '+ total +' " readonly /&gt;');
      $("input:radio").click(function()
      {
          total = 0;
          calcTotal();
          $("#total").html ('&lt;input style="border:0px" type="text" name="total" value=" '+ total +' " readonly /&gt;');
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>using the radio inputs to the option results in total</p>
  
  <p>option 1 <code>&lt;input name="shipp" type="radio" value="1234567" checked /&gt;</code> </p>
  
  <p>option 2 <code>&lt;input name="shipp" type="radio" value="2345678" /&gt;</code></p>
  
  <p>output: <code>&lt;div id=total&gt;&lt;/div&gt;</code></p>
  
  <p>I need help, how to make the view the total number of formats for thousands?, for example <strong>1234567</strong>, the result will be <strong>1,234,567</strong> ?</p>
  
  <p>thanks for help</p>