Como sumar datos de una tabla

Assumption:

  • all values format ar consistent,parseable and not empty strings

we parse a value like this:

import the System.Globalization Namespace
grafik

And:
grafik

Summing up the entire datatable:
mySum | Datatype: Double =

YourDataTableVar.AsEnumerable.Sum(Function (x) Double.Parse(x("Column1").toString.Trim, NumberStyles.Any,CultureInfo.CreateSpecificCulture("es-CO"))

Also have a look here:

And for the reformatting of a double:
grafik

2 Likes