Input string was not in a correct format - calculating total of labels
<p>Basically the first for statement below creates a list of testvalue labels depending on the user input.</p>

<p>The second for statement is supposed to work out the total of the dynamic labels created but when i play it i get an error saying "Input string was not in a correct format." relating to       <code>tots += double.Parse(value[p].ToString());</code> Any help would be appreciated. Thanks</p>

<pre><code>ArrayList value = new ArrayList();

int p =0;

for (int i = 0; i &lt; weight.Count; i++)
{
    Label test = new Label();
    System.Drawing.Point l8 = new System.Drawing.Point(440, 48 + s);
    test.Location = l8;
    value.Add(test);

    k += 35;

    Label l2 = testpercent1[i] as Label;
    Double.TryParse(l2.Text.Trim(), out label2);
    Label l = testpercent2[i] as Label;
    Double.TryParse(l.Text.Trim(), out label1);
    Double testvalue = Math.Round(((label1 * .3) + (label2 * .4)));
    test.Text = testvalue.ToString();
}

Double total = 0;
for (int p = 0; p &lt; value.Count; p++)
{
    tots += double.Parse(value[p].ToString());
}
</code></pre>
