I have this string \"1.79769313486232E+308\" and am trying to convert it to a .NET numeric value (double?) but am getting the below exception. I am using Convert.ToDo
Convert.ToDo
Demonstrates the issue and a solution:
var s = double.MaxValue.ToString(); double d; if (!double.TryParse(s, out d)) { d = s.Equals(double.MaxValue) ? double.MaxValue : double.MinValue; }