How can I return sum of List values that contains doubles?
If the List is of type Double, then this ought to do the trick →
If that doesn’t do the trick, then please provide us with some sample data so that we can test it out from out end.
Try this expression
(From d in dtData.AsEnumerable Where Not (isNothing(d(ColumnNameorIndex)) OrElse String.IsNullorEmpty(d(ColumnNameorIndex).toString.Trim)) Select v = CDbl(d(ColumnNameorIndex).toString.Trim)).Sum(Function (x) x)
Let’s take a simple expression
Doub_output = ListVariable.Sum(function(x) Convert.ToDouble(x) )
Glad it got resolved
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.