Reply To: [PARSING ERROR] PS4 – French (France) settings breaks NC

NodeCanvas Forums Support [PARSING ERROR] PS4 – French (France) settings breaks NC Reply To: [PARSING ERROR] PS4 – French (France) settings breaks NC

#13114
cayou_montreal
Participant

Ok guys, I’ve fixed it by changing the way fsJonsParser is parsing double values.
The issue was that double.TryParse with a value like “2.0” when the system is running in French (France) will fail because in French decimal values are written with a comma (2,0).
So I had to change the call to double.TryParse, from:
if (double.TryParse(numberString, out doubleValue) == false) {
to:
if (double.TryParse(numberString, NumberStyles.Number, CultureInfo.InvariantCulture, out doubleValue) == false) {

I don’t know if this issue was fixed on recent version of NC, but if not, this might be a huge blocker.
One more thing, I didn’t check the code, but maybe when serializing the BT in JSON the code should serialize it using no culture as well to avoid the same issue.

Cheers !