From 9165fe3870ba16b0abf332e305dd6b029da4b54f Mon Sep 17 00:00:00 2001 From: yomunsam Date: Thu, 13 Aug 2020 15:51:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug=EF=BC=9A=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=95=B4=E6=95=B0=E5=A6=82"1"=EF=BC=8C=E5=9C=A8json?= =?UTF-8?q?=E4=B8=AD=E4=BC=9A=E5=8F=98=E6=88=90"1.0"=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NekoSheet/Utils/NekoUtil.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NekoSheet/Utils/NekoUtil.cs b/NekoSheet/Utils/NekoUtil.cs index 258af46..0a06234 100644 --- a/NekoSheet/Utils/NekoUtil.cs +++ b/NekoSheet/Utils/NekoUtil.cs @@ -149,6 +149,8 @@ public static JProperty GetJsonProperty(string propertyName, string content, Fie case FieldType.String: return new JProperty(propertyName, content); case FieldType.Number: + if (int.TryParse(content, out int i_value)) + return new JProperty(propertyName, i_value); if(double.TryParse(content,out double d_value)) return new JProperty(propertyName, d_value); else @@ -191,6 +193,9 @@ private static object GetValueOrDefault(string content, FieldType type) case FieldType.String: return content; case FieldType.Number: + if (int.TryParse(content, out int i_value)) + return i_value; + if (double.TryParse(content, out double d_value)) return d_value; else