-Formatting

This commit is contained in:
James Newton-King
2015-12-27 14:31:36 +13:00
parent 00e75556a6
commit ce2a08dba2
52 changed files with 188 additions and 205 deletions
+5 -3
View File
@@ -414,7 +414,9 @@ namespace Newtonsoft.Json
/// <returns>A <see cref="Nullable{Int32}"/>. This method will return <c>null</c> at the end of an array.</returns>
public virtual int? ReadAsInt32()
{
switch (GetContentToken())
JsonToken t = GetContentToken();
switch (t)
{
case JsonToken.None:
case JsonToken.Null:
@@ -433,7 +435,7 @@ namespace Newtonsoft.Json
return ReadInt32String(s);
}
throw JsonReaderException.Create(this, "Error reading integer. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType));
throw JsonReaderException.Create(this, "Error reading integer. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, t));
}
internal int? ReadInt32String(string s)
@@ -632,7 +634,7 @@ namespace Newtonsoft.Json
}
double d;
if (double.TryParse(s, NumberStyles.Float, Culture, out d))
if (double.TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, Culture, out d))
{
SetToken(JsonToken.Float, d, false);
return d;