-
-
Notifications
You must be signed in to change notification settings - Fork 368
Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
No response
Describe the solution you'd like
目前我用检测是数值列就直接设置2位小数和居中对齐,不知道老张有啥好想法
DataTableDynamicContext = new DataTableDynamicContext(res, (Action<DataTableDynamicContext, ITableColumn>?) NumberFormatter());
public static Action<DataTableDynamicContext, ITableColumn> NumberFormatter()
{
return (context, col) =>
{
// 设置 数字列
if (col.PropertyType.IsNumberType())
{
col.FormatString = col.PropertyType == typeof(int) ? "" : "N2";
col.Align = Alignment.Center;
}
if (col.PropertyType == typeof(DateTime))
{
col.FormatString = "yyyy-MM-dd";
}
};
}
Additional context
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request