[]
Gets or sets the parsed number format.
public string NumberFormat { get; set; }
Public Property NumberFormat As String
CsvOpenOptions options = new CsvOpenOptions();
options.Parser = new NumberFormatParser();
string filePath = Path.Combine(Path.GetTempPath(), "percentage.csv");
File.WriteAllText(filePath, "Value\n15%");
workbook.Open(filePath, options);
IWorksheet activeSheet = workbook.ActiveSheet;
class NumberFormatParser : ICsvParser
{
public void Parse(CsvParseResult result, CsvParseContext context)
{
if (context.Text.EndsWith("%"))
{
result.NumberFormat = "0%";
string numberFormat = result.NumberFormat;
}
}
}