Sum of numeric field checkboxes in gridview
<p>I am having difficulties in assigning double value (for example 124.00) of label text in asp.net. This label is in content page of .net master page.</p>

<p>But I am having the following two problems:</p>



<pre><code>&lt;script type="text/javascript"&gt;
 var totalAmount = 0; //Defined global variable;

function addval(vals)  //I am passing vals(Double from sever side)
{
totalAmount = totalAmount + vals;
(document.getElementsByTagName("&lt;%= lblCurrentProductTotal.ClientID %&gt;")).value= totalAmount.toString();
}


&lt;/script&gt;
</code></pre>

<ul>
<li><p>Each time "clickCh" is called; this sets the <code>totalAmount</code> (a global variable) with the parameter passed. It's like if I pass <code>145</code> first time it assigns as <code>"0145"</code> and second time if I pass <code>156</code>  the totalAmount becomes <code>"0145156"</code> as I am expecting it to add as <code>145+156=301</code>.</p></li>
<li><p>It's not assigning the value to the label "lblCurrentProductTotal"
Please let me know if i am missing something.</p></li>
</ul>

<p>Thanks in advance!</p>
