Is there an easy way to directly convert my list of string into double data type and get the average value.
Here is my current list result:
["6.3000e-009", "7.3319e-009", "7.8303e-009"]
expected result:
7.15E-09
Any suggestion/Comments TIA.
Is there an easy way to directly convert my list of string into double data type and get the average value.
Here is my current list result:
["6.3000e-009", "7.3319e-009", "7.8303e-009"]
expected result:
7.15E-09
Any suggestion/Comments TIA.
You can use Linq to get the average:
var avg = input.Select(double.Parse).Average();
you can use Linq to objects to do this quite easily
something like..(untested)
var result = yourArray.Select( s => Double.Parse(s) ).Average();