Input string was not in a correct format/ convert double

Hello guys,
I need to convert “1,67 €” which is set variable as price, a string to double.
I did “fiyat=price.Replace(” “,”").Replace(“€”,"").ToString"
after that
final=Double.Parse(fiyat) where the final is should be double variable.
However, I am getting the error that “Input string was not in a correct format”
Anybody can help me?
Thank you

Hi @Basak_Demirel

I think You need to remove , as well.

Hi,

Can you try the following expression?

Double.Parse(fiyat,System.Globalization.CultureInfo.CreateSpecificCulture("fr-FR"))

Regards,

Hi @Basak_Demirel

You can try in this method.

Convert.ToDouble(strVal)

Thanks.

Happy Automation

It works! Thanks a lot

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.