Strange javascript addition problem
<p>I have this code:</p>

<pre><code>var totalAmt=0;
for (i in orders)
{
   order=orders[i];
   if (order.status !='Cancelled')
        totalAmt=totalAmt + order.amount;
}
</code></pre>

<p>But if i have 3 orders with amounts 3, 1, and 5, then instead of <code>totalAmt</code> being 9, i get <code>0315</code>. So I think its adding the amounts together as strings instead of integars.</p>

<p>How do I fix this?</p>
