BikeRouter.Web.Technical.Utils.ToDoubleTolerate C# (CSharp) Метод

ToDoubleTolerate() публичный статический Метод

public static ToDoubleTolerate ( String input ) : double
input String
Результат double
        public static double ToDoubleTolerate(String input)
        {
            IFormatProvider provider = CultureInfo.InvariantCulture.NumberFormat;
            double output = -1;
            Double.TryParse(input, NumberStyles.Float, provider, out output);
            return output;
        }

Usage Example

Пример #1
0
        public static List <Station> ProcessManualCity(String path)
        {
            XDocument xDoc = XDocument.Load(path);

            var stations = (from station in xDoc.Descendants("station")
                            select new Station
            {
                Address = station.Attribute("name").Value,
                Lat = Utils.ToDoubleTolerate(station.Attribute("lat").Value),
                Lng = Utils.ToDoubleTolerate(station.Attribute("lng").Value),
                Free = -1
            }).ToList();

            return(stations);
        }