Reputation: 1704
I need to add split string values to get the rounded value.
string Temp1="0.0154275894165039,1.11531066894531,0.294834136962891,";
string[] Temp2=Temp1.Split(',');
How to sum the values coming in "temp2" and assign it to another parameter.
Upvotes: 0
Views: 268
Reputation: 19305
Consider also passing CultureInfo.InvariantCulture
to double.Parse
. Otherwise your solution will fail on systems running on certain localization settings.
Upvotes: 1
Reputation: 25595
Try this:
double dSum = 0;
foreach (string sStr in Temp2)
dSum += Double.parse(sStr);
Upvotes: 6