VS:2019 Framework:3.1
I have the following code:
string output="";
string[] numbers= line.Split(" ",StringSplitOptions.RemoveEmptyEntries);
output += string.Format("{0:000.0000} ", Double.Parse(numbers[2]));
output += string.Format("{0:000.0000}" ,Double.Parse(numbers[3]));
output += string.Format("{0,10:0.0000}" ,Double.Parse(numbers[4]));
Where line is an input file string. This string contains decimal numbers like 255.1905. I'm writing this code on an English windows system, and it works completely fine, but when I try running the program on a Hungarian system, it throws the following exception: "input string was not in a correct form".
I'm guessing the problem lies in the decimal point, since the Hungarian language uses "," instead of ".", but I can't seem to figure out a solution.
I've tried Double.Parse(szamok[2], new System.Globalization.CultureInfo("en-US"))
and Double.Parse(szamok[2], System.Globalization.CultureInfo.InvariantCulture)
but they didn't help, maybe I used them wrong.