Adding Rows containing currency

From variables Panel Which is located at bottom in Uipath Studio.

grafik


error message : option strict…

@Ridwan_Satrio1 I think there is misplaced characters in amount means instead of 4.680.000,00 it should be like 4,680,000.00 Right?

but the excel input file given in this case is like that. So, I’m having a hard time finding out how to add up the rows, what’s more, there’s a (-) sign in one of the numbers

as several options were suggested, which one did you tried and what was working or not working.

About the differen local number format following approach should work
grafik

umm im so sorry but i dont understand what mean of ci, a, d, v and “de-DE” and x in RHS

Create a variable:
grafik

Use an assign activity done as here
grafik

And replace YourDataTableVar with the variable name of you datatable

it is using LINQ within the statement, we do use these like local variables
[HowTo] LINQ (VB.Net) Learning Catalogue - Help / Something Else - UiPath Community Forum

OR

As also mentioned you can implement it within a for each row approach and parsing the string into an integer was mentioned here:


how to fix it? can help me again?

start analysis by using a single assign activity. Bring it out from the muliple assign.

okey i got it, and how about it?

set a breakpoint on the failling assign activity
debug and get paused
open immediate panel and type in:
dt_jurnal.Rows(0)(“Transaction Amount”).toString

we want to check the value within the datatable

Maybe the sum exceeds the maximum value of an int32 and we will change the datatype. But lets check out first the result from analysis above

i got it this error, why?

we need to analyze it and mentioned the first anylsis steps for this.

Thanks for supporting us by sharing the result with us


im so sorry im new in uipath, i feel happy for your help, thx.god bless

for training help have a look here:
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

the robot is always stop, but wait a sec

got it

image

how?

As mentioned and part of default analysis, the internal value representation within the datatable is driving the convertion strategies, not the visuals from excel.

it looks that it has the default formatings and the decimal seperator / group seperator is confused.

Change the datatype of totalTA to Double

Use following LINQ

(From d in YourDataTableVar.AsEnumerable
Let ci = System.Globalization.CultureInfo.InvariantCulture
Let a = d("Transaction Amount").toString.Trim
Where Double.TryParse( a ,NumberStyles.Any, new CultureInfo("de-DE"), nothing )
Select v = Double.Parse(a,NumberStyles.Any,ci)).Sum(Function (x) x)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.