6
I have a method that gets values like string
and performs the conversion to other types, my problem is that when converting an information to double
It changes its precise value so that it doesn’t happen. For example, I get "19.30". use the method below to convert and end up with the value "1930,00", or something similar.
I get "19.30" in variable x.
val = Convert.ToDouble(x);
The value of val is for example: "19300,0" but I need the value to be the same as in string: "19.30", for I will use it to do various calculations with it. If you can convert to currency also serves as long as the format is the same as I receive as string
Is there any method to make this conversion without changing the value?
OK thanks for the answers but I will use this one because it is very easy to use. Convert.Todouble(value, Cultureinfo.Invariantculture)
– user9090
I believe for your case it is. I’ll even improve some things (after the game :) )
– Maniero