From a75d34b8aea14d1a1e4d38c7bcfa1f604cd0bb5e Mon Sep 17 00:00:00 2001 From: Gonzalo Zawadzki Date: Mon, 27 Jun 2016 14:15:58 +0100 Subject: [PATCH] [BUG] Set format and culture when converting float to string in JsonObject --- LearnositySDK/Utils/JsonObject.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/LearnositySDK/Utils/JsonObject.cs b/LearnositySDK/Utils/JsonObject.cs index bdd2fd0..6797f7c 100755 --- a/LearnositySDK/Utils/JsonObject.cs +++ b/LearnositySDK/Utils/JsonObject.cs @@ -5,6 +5,7 @@ using System.Collections; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using System.Globalization; namespace LearnositySDK.Utils { @@ -626,7 +627,7 @@ public string toJson() } else if (this.df.ContainsKey(key)) { - sb.Append(this.df[key].ToString()); + sb.Append(this.df[key].ToString("R", CultureInfo.InvariantCulture)); } else if (this.ds.ContainsKey(key)) { @@ -677,7 +678,7 @@ public string toJson() sb.Append(","); } - sb.Append(Json.encode(item.Key) + ":" + item.Value.ToString()); + sb.Append(Json.encode(item.Key) + ":" + item.Value.ToString("R", CultureInfo.InvariantCulture)); index++; }