-1
Good evening, everyone,
I am trying to solve a challenge in C# but when I try to convert two variable string with point (Ex. 1.0 7.0) to two double variables, loses the point and is 10 70. Can someone tell me what I’m doing wrong?
double x1 , x2;
Console.WriteLine();
value = Console.ReadLine();
String[] substrings = value.Split(delimiter);
x1 = Convert.ToDouble(substrings[0]);
x2 = Convert.ToDouble(substrings[1]);
I believe that the negative was because this question has been answered several times here: Problem with Decimal (4.2),Problems with Double formatting, etc...
– William John Adam Trindade
I understand, but I noticed a different way of solving the problem, changing the point by comma... maybe it is not the best practice but it also worked.
– izabel