I have a situation where I am scraping data from SAP (German Client) and when I download the amount it is like 98.765,78 I need to convert this to double so that this is necessary for other calculations.
I have tried these options to display in the log message
Double.Parse(str_Currency).ToString
Double.Parse(str_Currency,0).ToString
I get the following error
Log Message: Input string was not in a correct format.
Firstly you have to swap the dot with comma after that you can use Convert.ToDouble method
InProperString = 98.765,78
ProperString= 98,765.78
Convert.ToDouble(ProperString)
Here is a sequence I have developed based on a similar thread which discusses this problem:
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 →