[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.CsvParseResult.NumberFormat

NumberFormat Property

NumberFormat

Gets or sets the parsed number format.

Declaration
public string NumberFormat { get; set; }
Public Property NumberFormat As String
Examples
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;
        }
    }
}