Hello everyone,
i’m trying to sum a column in excel that looks like this
But the result i am gettin is -2211 while it should be -22,11. can someone explain to me how i can get the sum of decimals?
thank u
After getting the sum You can use Format value activity
https://docs.uipath.com/activities/docs/format-value
Regards
Sudharsan
it gives me this type of error
(this is what i did to get the sum: DTFoglio7.AsEnumerable.Sum(Function(row) Cint(row(“Imp_base_imp”)))
we assume that your local is e.g. Spain. So the Group seperator is comma and we do handle like:
Double.Parse(YourStringVar, System.Globalization.CultureInfo.CreateSpecificCulture("es-ES"))
DTFoglio7.AsEnumerable.Sum(Function(row) Double.Parse(row("Imp_base_imp").toString.Trim, System.Globalization.CultureInfo.CreateSpecificCulture("es-ES")))
it worked thank you!
last thing is that it gives me 22.11 while i would want 22,11 … what should i change?
Try Ro-ro instead of Es-es @olimpia.sannucci
Regards
Sudharsan
maybe Italian locals will better match but can be adapted as needed. (Also RO for romania, but is a little surprising)
Once we had converted it into a double, the internals are . dot for the decimal seperator
When we do need a different representation we can again apply the locals / or customize it:
To shorten it we would recommend the following:
import to the namespaces
Variable:
myCI | CultureInfo = new CultureInfo(“it-IT”)
then it is like:
Double.Parse(“-123.456,67”, myCI).ToString(“N2”, myCI)
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.