i have a problem to sum up the value.
for example:
in my richtextbox1:
0.94
0.83
1.67
0.50
0.67
1.25
0.98
now i wan to total up the value.
if the value is less than 1 , then total is 5.
if the value is greater than 1, then total is 2.
below are my coding, but cannot work.
int count = 0;
double liftV = richTextBox24.Lines.Length;
if (liftV <1.00)
{
count++;
}
textBox5.Text=count.ToString();
hope someone can help me..
Loading
jayakrishnan MorayurPosted Apr 11, 2011, 2:13 AM
Double total=0;
for (int i = 0; i < richTextBox1.Lines.Length-1; i++)
{
if (Convert.ToDouble(richTextBox1.Lines[i]) < 1.00)
{
count++;
total=total+Convert.ToDouble(richTextBox1.Lines[i]);
}
}
textBox1.Text = count.ToString();
the variable total gives the total of value lessthan 1.00