File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,12 @@ public static string ConvertToPercentString(this string? val)
5050 /// <returns></returns>
5151 public static bool IsNumber ( this Type t )
5252 {
53+ var separator = CultureInfo . CurrentCulture . NumberFormat . NumberDecimalSeparator ;
54+ if ( separator != "." )
55+ {
56+ return false ;
57+ }
58+
5359 var targetType = Nullable . GetUnderlyingType ( t ) ?? t ;
5460 return targetType == typeof ( int ) || targetType == typeof ( long ) || targetType == typeof ( short ) ||
5561 targetType == typeof ( float ) || targetType == typeof ( double ) || targetType == typeof ( decimal ) ;
Original file line number Diff line number Diff line change 77using Microsoft . Extensions . Localization ;
88using System . ComponentModel ;
99using System . Data ;
10- using System . Globalization ;
1110using System . Linq . Expressions ;
1211using System . Reflection ;
1312
@@ -193,11 +192,6 @@ public static class Utility
193192 ? null
194193 : CacheManager . GetPlaceholder ( modelType , fieldName ) ;
195194
196- /// <summary>
197- /// 获得 当前输入语言小数点分隔符
198- /// </summary>
199- private static string NumberDecimalSeparator => CultureInfo . CurrentCulture ? . NumberFormat ? . NumberDecimalSeparator ?? "." ;
200-
201195 /// <summary>
202196 /// 通过 数据类型与字段名称获取 PropertyInfo 实例方法
203197 /// </summary>
@@ -644,7 +638,7 @@ private static Type GenerateComponentType(IEditorItem item)
644638 {
645639 ret = typeof ( NullSwitch ) ;
646640 }
647- else if ( fieldType . IsNumber ( ) && NumberDecimalSeparator == "." )
641+ else if ( fieldType . IsNumber ( ) )
648642 {
649643 ret = typeof ( BootstrapInputNumber < > ) . MakeGenericType ( fieldType ) ;
650644 }
You can’t perform that action at this time.
0 commit comments