Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ExcelMapper/ExcelMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,10 @@

object GetCellValue(ICell cell, ColumnInfo targetColumn)
{
if (targetColumn.TextPlain)
{
return DataFormatter.FormatCellValue(cell);

Check warning on line 852 in ExcelMapper/ExcelMapper.cs

View check run for this annotation

Codecov / codecov/patch

ExcelMapper/ExcelMapper.cs#L851-L852

Added lines #L851 - L852 were not covered by tests
}
var formulaResult = cell.CellType == CellType.Formula && (targetColumn.PropertyType != typeof(string) || targetColumn.FormulaResult);
var cellType = formulaResult ? cell.CachedFormulaResultType : cell.CellType;

Expand Down
7 changes: 7 additions & 0 deletions ExcelMapper/TypeMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@
/// <c>true</c> if the property will be serialized as JSON; otherwise, <c>false</c>.
/// </value>
public bool Json { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to get the value in plain text.
/// </summary>
/// <value>
/// <c>true</c> if the property will be serialized as JSON; otherwise, <c>false</c>.
/// </value>
public bool TextPlain { get; set; }

Check warning on line 112 in ExcelMapper/TypeMapper.cs

View check run for this annotation

Codecov / codecov/patch

ExcelMapper/TypeMapper.cs#L112

Added line #L112 was not covered by tests

static readonly HashSet<Type> NumericTypes = new HashSet<Type>
{
Expand Down