1
Vote

Parsing small numbers from dot throw invalid format error

description

For example:

Parsing 3.0254e-015 from dot with Numberstyle "Number" returns this specific error. However it could be fixed by replacing the NumberStyle to "Any". But that just a quick workout, maybe there are much better options. In this case the TryParseInvariantDouble function was called from GetPosition(string value) in DotEdge.cs

File "Utils.cs"
public static bool TryParseInvariantDouble(string str, out double number)
Replace:
return double.TryParse(str, NumberStyles.Number, CultureInfo.InvariantCulture, out number);
With:
return double.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out number);
cheers,

Björn

comments