Не могу конвертировать string в double - C#
Формулировка задачи:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Xml;
namespace конверт
{
class xmlLinqPars
{
public string koef;
string kurs="USD-EUR";
XElement root = XElement.Load("data.xml");
public double Perebor()
{
foreach (XElement seg in root.Descendants(kurs))
{
koef = seg.Value;
}
return (double)koef; // тут ругается visual studio
}
}
}Решение задачи: «Не могу конвертировать string в double»
textual
Листинг программы
return Convert.ToDouble(koef);