Xceed Workbooks for .NET v3.0 Documentation
Xceed.Workbooks.NET Assembly / Xceed.Workbooks.NET Namespace / Style Class / PredefinedNumberFormatId Property


In This Topic
    PredefinedNumberFormatId Property (Style)
    In This Topic
    Gets or sets the predefined number format that will be used to format the content of a Cell, the Cells in a Column or the Cells in a Row.
    Syntax
    'Declaration
     
    
    Public Property PredefinedNumberFormatId As Integer
    'Usage
     
    
    Dim instance As Style
    Dim value As Integer
     
    instance.PredefinedNumberFormatId = value
     
    value = instance.PredefinedNumberFormatId
    public int PredefinedNumberFormatId {get; set;}
    Remarks

    The predefined number formats are represented by Ids.

    The default value is 0.

     

    Here is the list of the predefined formats Ids that can be set:

    ID FormatCode
    0 General
    1 0
    2 0.00
    3 #,##0
    4 #,##0.00
    9 0%
    10 0.00%
    11 0.00E+00
    12 # ?/?
    13 # ??/??
    14 mm-dd-yy
    15 d-mmm-yy
    16 d-mmm
    17 mmm-yy
    18 h:mm AM/PM
    19 h:mm: ss AM/ PM
    20 h:mm
    21 h:mm:ss
    22 m/d/yy h:mm
    37 #,##0 ;(#,##0)
    38 #,##0 ;[Red](#,##0)
    39 #,##0.00;(#,##0.00)
    40 #,##0.00;[Red](#,##0.00)
    45 mm:ss
    46 [h]:mm:ss
    47 mmss.0
    48 ##0.0E+0
    49 @

     

    Note that setting this property will overwrite the CustomFormat property.

    Supported Frameworks

    .NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.

    .NET Framework: net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.

    See Also