Need to convert scraped string into double, the number is in German format

Hi @manjesh_kumar ,

Here is a sequence I have developed based on a similar thread which discusses this problem:

image

Basically, you have to play around with the CultureInfo to get what you want.
In this scenario, you are dealing with Portugal Numbers, so you have to implicitly specify what the formats are before referencing the Culture Info.

For that, first create a variable of type System.Globalization.CultureInfo and initialize it using this →

New CultureInfo("pt-PT")

Next, use two assign activity like so:

cul_info.NumberFormat.NumberGroupSeparator = "."
cul_info.NumberFormat.NumberDecimalSeparator =","

This tells the robot all it needs to know about how to go about processing the given string.

After that is done, all that is left is to convert our string to Double →

Convert.ToDouble("98.765,78",cul_info)

ConvertDoubleFromPortugal.xaml (6.4 KB)

Kind Regards,
Ashwin A.K

1 Like