소스 검색

Merge remote-tracking branch 'origin/kenric' into frank

frankvandenbos 2 달 전
부모
커밋
c286e6ec73
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 12 0
      InABox.Core/DigitalForms/Layouts/Fields/DFLayoutDoubleField/DFLayoutDoubleFieldProperties.cs

+ 12 - 0
InABox.Core/DigitalForms/Layouts/Fields/DFLayoutDoubleField/DFLayoutDoubleFieldProperties.cs

@@ -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;