uipathuipath-studio

UiPath - parse numeric string with thousands separator from excel to number


I am quite new to RPA and want to parse and want to parse some excel values to a number format.

The numbers in this excel are interpreted as text and looking like this 1.500.000,00 Note that there are some spaces at the beginning and dots as thousands separator.

Now in UiPath, I want to read the value, convert them into a double or float and write back to excel.

I've tried to replace spaces and dots by "", so only the number with a decimal comma is left. enter image description here

This works, but the cell is still formatted as text. enter image description here

How to format an excel cell as number in UiPath?


Solution

  • In C#:

    float.Parse("1500000,00", CultureInfo.InvariantCulture.NumberFormat);
    

    Additionally have a look here: Converting String To Float in C#