using System;
namespace Progaram
{
public static class Program
{
static double Calculate(string userInput)
{
string[] num = userInput.Split(' ');
double a = double.Parse(num[0]); //Вот тут выходит ошибка: System.FormatException: "Input string was not in a correct format."
return a;
}
static void Main()
{
string userInput = "100.00 12 1";
Console.WriteLine(Calculate(userInput));
}
}
}
var result = double.Parse("42.69", System.Globalization.CultureInfo.InvariantCulture);