I scraped a big list with numbers, how to get avarage number? MATH Question

Matzedoon

Пользователь
Регистрация
16.12.2016
Сообщения
32
Благодарностей
1
Баллы
8
I got a big list with numbers.. Example
0.005432
0.005654
0.004325
0.003234

100 of these in a list, what is the easiest way to get the average number of this list ?
 

Nord

Client
Регистрация
22.03.2012
Сообщения
2 401
Благодарностей
1 464
Баллы
113
Sum up all the numbers and divide by 100:-)
 

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
526
Благодарностей
112
Баллы
43
You must write a c# code.
Код:
var lst = project.lists["list1"];
decimal sum = 0;
int i = 0;
while (int < lst.count){
   sum = sum + Convert.ToDecimal(lst[i]);
   i++;
}
return sum / i;
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)