I have a gridview that contains string value but was number/integer
e.g: "1", "10"
problem was I also have data that was -
on it and since its a char it cannot convert to integer.
here is a line of my lambda:
var gp_lt = gridData.Where(n => n.Profit != "-" && Convert.ToInt32(n.Profit) >= 0).Select(o => new { o.Profit });
double grossprofit_LT = gp_lt.Sum(o => Convert.ToDouble(o.Profit));
Profit = number
but was string
...
value of -
was not 0
... just want to exclude all those who has -
and convert the profit to int
. Thanks in advance!