auto
August 21, 2019, 7:38am
1
my string is captured as per title, but I cannot use integer.parse (String) in the data row.
How do I get it to recognize the correct amount and pasted in Excel correctly as a currency?
For now, the numbers are “pasted as text” and I am unable to sum them unless I convert them in Excel - not ideal.
@auto Use string replace method to replace “$”(if your required replace “,”) with null value(“”).
auto
August 21, 2019, 9:39am
3
it still gets stored as TEXT in Excel. Able to share a sample script please?
Hi Greetings!
InputString.Replace(“$”,“”).Replace(“,”,“”)
This will return only number. Then u can use it in add data row.
Thanks!
@auto You wanted to sum the values in excel or you can sum the values in datatable also?
AryanSingh
(Aryan Singh)
August 21, 2019, 10:34am
6
@auto
You need to first replace the “$” & “,” with “”(Empty string). then convert the variable to Double type.
Convert.ToDouble(“RetrievedVariable”.Replace(“$”,“”).Replace(“,”,“”))
or
You can do it using the other method of Interger.Parse(“RetrievedVariable”.Replace(“$”,“”).Replace(“,”,“”))
Hope it works!!
Cheers buddy.
Hi @auto
The comments by others are quite enough for you to figure out a way to remove the characters and convert it to double.
Your other concern, sum them up, Yes. You can sum the records within a datatable itself. The code is kind of lengthy. But you can easily use the below component to get it done.
Install it and use the consolidate data table activity to get the aggregated datatable according to your requirement.
https://go.uipath.com/component/datatable-plugins
Hope it helps
1 Like
auto
September 17, 2019, 7:02am
8
Hi guys,
I am still getting the error shown below. Appreciate if someone can post a sample script so that I can take reference from there. Thank you!