I’m new to UIpath and I stumbled across a problem I’m unable to solve. I have a datatable with string values (obtained through data scraping), of which I want to convert some to decimal values (see example below). Convert.ToDecimal() doesn’t seem to apply on datatables (or datacolumns).
Thanks to your help, I managed to figure it out! Turns out my row-iteration was wrong, after fixing that the ‘normal’ Convert.ToDecimal worked out perfectly in an assign activity.
Solution:
Use a for each row activity to iterate over cell values (within the datatable)
Use an assign activity to perform the following operation:
a. row.Item(“col1”) = Convert.ToDecimal(row.Item(“Col1”))
It should look something like this:
*where DT is the example datatable
NB: while performing this operation on currency data, it failed on strange symbols (€), so I used @MAHESH1’s solution to keep only numerical values from a string: