Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion LearnositySDK/Utils/JsonObjectFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.IO;
using System.Numerics;
using System.Xml.Linq;

namespace LearnositySDK.Utils
{
Expand Down Expand Up @@ -98,7 +100,14 @@ public static JsonObject fromJToken(JsonObject jsonObject, string key, JToken it
jsonObject.set(key, (int)item);
break;
case JTokenType.Float:
jsonObject.set(key, (decimal)item);
try
{
jsonObject.set(key, (float) item);
}
catch (OverflowException)
{
jsonObject.set(key, float.MaxValue);
}
break;
case JTokenType.String:
jsonObject.set(key, (string)item);
Expand Down