System.FormatException on double.Parse

Sep 2, 2010 at 1:36 PM

Hello.

I was using GAPI and noticed a System.FormatException. It occurs in the line 41 of JsonNumber.cs which has the contents

value = double.Parse(str.Substring(startPos, position - startPos));

 

Having read http://stackoverflow.com/questions/1354924/c-how-do-i-parse-a-string-with-a-decimal-point-to-a-double I tried it with

value = double.Parse(str.Substring(startPos, position - startPos),System.Globalization.CultureInfo.InvariantCulture);

 and now works well.

Maybe you are from an English native speaking zone and you don't notice these problems; here, in Portugal, we use commas as the decimal separator and that explains the reason why the GAPI.Test program breaks.