diff --git a/ExcelMapper/ExcelMapper.cs b/ExcelMapper/ExcelMapper.cs index b58971b..ed589b6 100644 --- a/ExcelMapper/ExcelMapper.cs +++ b/ExcelMapper/ExcelMapper.cs @@ -847,6 +847,10 @@ Dictionary GetColumns(ISheet sheet, TypeMapper typeMapper) object GetCellValue(ICell cell, ColumnInfo targetColumn) { + if (targetColumn.TextPlain) + { + return DataFormatter.FormatCellValue(cell); + } var formulaResult = cell.CellType == CellType.Formula && (targetColumn.PropertyType != typeof(string) || targetColumn.FormulaResult); var cellType = formulaResult ? cell.CachedFormulaResultType : cell.CellType; diff --git a/ExcelMapper/TypeMapper.cs b/ExcelMapper/TypeMapper.cs index f7c449f..d0f04f2 100644 --- a/ExcelMapper/TypeMapper.cs +++ b/ExcelMapper/TypeMapper.cs @@ -103,6 +103,13 @@ public PropertyInfo Property /// true if the property will be serialized as JSON; otherwise, false. /// public bool Json { get; set; } + /// + /// Gets or sets a value indicating whether to get the value in plain text. + /// + /// + /// true if the property will be serialized as JSON; otherwise, false. + /// + public bool TextPlain { get; set; } static readonly HashSet NumericTypes = new HashSet {