Adding two floats and assigning the total to a input field
<p>as the title states, I am trying to add two floats using javascript/jquery, and then assign the value to another input field, but sometimes when I add the two I get something like 1234.567800000000, any idea on how I can fix this?</p>

<p>EDIT: I would like something like this, 1234.56</p>

<p>here is my code,</p>

<p>jQuery:</p>

<pre><code>$("[data-custom*='min_sys'], [data-custom*='min_inst'], [data-custom*='max_sys'], [data-custom*='max_inst']").live('keyup',function(){
 //the parent
 var parent = $(this).closest('[class*="costing"]');

 var one = Number(parent.find('[data-custom*="max_sys"]').val());
 var two = Number(parent.find('[data-custom*="max_inst"]').val());
 var sum = one+two;

        //here I set the value of the 'total_inst input' box to the variable 'sum'
 var total = parseFloat(parent.find('[data-custom*="total_inst"]').val(sum));

});
</code></pre>

<p>Also, what would be the best way to store a float like that (the total) in a database, what data type would be the best?</p>

<p>Thanx in advance!</p>
