|
@@ -1,4 +1,5 @@
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
+using System;
|
|
|
|
|
|
namespace InABox.Core
|
|
|
{
|
|
@@ -39,6 +40,17 @@ namespace InABox.Core
|
|
|
var value = entry.GetValue();
|
|
|
if (value is double d)
|
|
|
return d;
|
|
|
+ if (value != null && value.GetType().IsNumeric())
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ return Convert.ToDouble(value);
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
if (double.TryParse(value as string, out var result))
|
|
|
return result;
|
|
|
return null;
|