BikeInCity.Web.Technical.WebUtils.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 = WebUtils.ToDoubleTolerate(station.Attribute("lat").Value),
                Lng = WebUtils.ToDoubleTolerate(station.Attribute("lng").Value),
                Free = -1
            }).ToList();

            return(stations);
        }