using System; using System.Collections.Generic; using System.Text; namespace XYY.Core.Standard.ExcelHelper.MSExcelHelper { public static class ExcelFormattextHelper { public static string Date => "yyyy-mm-dd"; public static string DateTime => "yyyy-m-d h:mm:ss"; public static string Text => "@"; public static string Percentage => "#0.00%"; public static string Amount => "#,##0.00"; public static string DefaultAmount => "#,##0.000"; public static string GetColumnFormattext(Type pt) { if (pt == typeof(string)) return ExcelFormattextHelper.Text; if (pt == typeof(DateTime)) return ExcelFormattextHelper.DateTime; if (pt == typeof(decimal)) return ExcelFormattextHelper.Amount; else return null; } } }