Skip to content
Browse files

Changed parsing of numbers to using the invariant namespace to make i…

…t possible to parse floating point numbers in locales with a different decimal symbol than "."
  • Loading branch information...
1 parent 3f1c781 commit b8d4660fc6eb8d3a96e42a6aca48e2fc348022ae Tore committed Mar 16, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/LitJson/JsonReader.cs
View
3 src/LitJson/JsonReader.cs
@@ -13,6 +13,7 @@
using System.Collections.Generic;
using System.IO;
using System.Text;
+using System.Globalization;
namespace LitJson
@@ -257,7 +258,7 @@ private void ProcessNumber (string number)
number.IndexOf ('E') != -1) {
double n_double;
- if (Double.TryParse (number, out n_double)) {
+ if (Double.TryParse (number, NumberStyles.Float, System.Globalization.NumberFormatInfo.InvariantInfo, out n_double)) {
token = JsonToken.Double;
token_value = n_double;

0 comments on commit b8d4660

Please sign in to comment.
Something went wrong with that request. Please try again.