Syncfusion.XlsIO.Base
Example 


Syncfusion.XlsIO Namespace > IExtendedFormat Interface : IncludeNumberFormat Property

IncludeNumberFormat Property

True if the IStyle includes the NumberFormat property. Read / write Boolean.
Syntax
'Declaration
 
Property IncludeNumberFormat As Boolean
'Usage
 
Dim instance As IExtendedFormat
Dim value As Boolean
 
instance.IncludeNumberFormat = value
 
value = instance.IncludeNumberFormat
bool IncludeNumberFormat {get; set;}
Example
The following code illustrates how to exclude NumberFormat for a specific IStyle object.
using Syncfusion.XlsIO;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Set values
            worksheet["C2"].Value = "1200.40";
            worksheet["E2"].Value = "1200.40";
            
            //Add style
            IStyle style = workbook.Styles.Add("CustomStyle");
            
            //Set number format index
            style.NumberFormat = "# ?/?";
            
            //Set include number format
            style.IncludeNumberFormat = false;
            
            //Set modified style
            worksheet["C2"].CellStyle = style;
            
            //Get extended format
            IExtendedFormat format = worksheet["E2"].CellStyle;
            
            //Set number format index
            format.NumberFormat = "# ?/?";
            
            //Set include number format
            format.IncludeNumberFormat = false;
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.2460.0.34

See Also