Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
Fix invalid JSON caused by localized decimal mark
Browse files Browse the repository at this point in the history
Using InvariantCulture to convert the double to string to generate a dot instead of a comma.
  • Loading branch information
WolfspiritM committed Jul 28, 2016
1 parent 4eb28ab commit 3669e5f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Globalization;
using Newtonsoft.Json;

namespace Glimpse.Internal
Expand All @@ -15,7 +16,7 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s
result = Math.Round(convertedNullable.Value.TotalMilliseconds, 2);
}

writer.WriteRawValue(result.ToString());
writer.WriteRawValue(result.ToString(CultureInfo.InvariantCulture));
}

public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
Expand Down

0 comments on commit 3669e5f

Please sign in to comment.