FormatImpl Class
Represents number format. Responsible for reading, writing, parsing, applying, checking and other operations with number formats.
Inherited Members
Namespace: Syncfusion.XlsIO.Implementation
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public class FormatImpl : CommonObject, IDisposable, INumberFormat, IParentApplication, ICloneParent
Constructors
FormatImpl(IApplication, Object)
Initializes new instance of the format.
Declaration
protected FormatImpl(IApplication application, object parent)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object for the new format. |
System.Object | parent | Parent object for the new format. |
FormatImpl(IApplication, Object, Int32, String)
Initializes new instance of the format.
Declaration
public FormatImpl(IApplication application, object parent, int index, string strFormat)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object for the new format. |
System.Object | parent | Parent object for the new format. |
System.Int32 | index | Format index. |
System.String | strFormat | Format string. |
Properties
DecimalPlaces
Number of digits after "." sign in the first section of this number format. Read-only.
Declaration
public int DecimalPlaces { get; }
Property Value
Type |
---|
System.Int32 |
FormatString
Returns format string. Read-only.
Declaration
public string FormatString { get; }
Property Value
Type |
---|
System.String |
FormatType
Returns format type of the first section of this number format. Read-only.
Declaration
public ExcelFormatType FormatType { get; }
Property Value
Type |
---|
ExcelFormatType |
Index
Returns format index. Read-only.
Declaration
public int Index { get; }
Property Value
Type |
---|
System.Int32 |
IsFraction
Indicates whether the first section of this number format contains fraction sign. Read-only.
Declaration
public bool IsFraction { get; }
Property Value
Type |
---|
System.Boolean |
IsScientific
Indicates whether first section of this number format contains E/E+ or E- signs in format string. Read-only.
Declaration
public bool IsScientific { get; }
Property Value
Type |
---|
System.Boolean |
IsThousandSeparator
Indicates whether thousand separator is present in the first section of this number format. Read-only.
Declaration
public bool IsThousandSeparator { get; }
Property Value
Type |
---|
System.Boolean |
Record
Returns format record that contains low-level information about format. Read-only.
Declaration
[CLSCompliant(false)]
public FormatRecord Record { get; }
Property Value
Type |
---|
Syncfusion.XlsIO.Parser.Biff_Records.FormatRecord |
Methods
ApplyFormat(Double)
Applies format to the value.
Declaration
public string ApplyFormat(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Value to apply format to. |
Returns
Type | Description |
---|---|
System.String | String representation of the value according to the number format. |
ApplyFormat(Double, Boolean)
Applies format to the value.
Declaration
public string ApplyFormat(double value, bool bShowHiddenSymbols)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Value to apply format to. |
System.Boolean | bShowHiddenSymbols | Indicates whether to show hidden symbols. |
Returns
Type | Description |
---|---|
System.String | String representation of the value according to the number format. |
ApplyFormat(String)
Applies format to the value.
Declaration
public string ApplyFormat(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | Value to apply format to. |
Returns
Type | Description |
---|---|
System.String | String representation of the value according to the number format. |
ApplyFormat(String, Boolean)
Applies format to the value.
Declaration
public string ApplyFormat(string value, bool bShowHiddenSymbols)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | Value to apply format to. |
System.Boolean | bShowHiddenSymbols | Indicates whether to show hidden symbols. |
Returns
Type | Description |
---|---|
System.String | String representation of the value according to the number format. |
Clone(Object)
Creates a new object that is a copy of the current instance.
Declaration
public object Clone(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for a copy of this instance. |
Returns
Type | Description |
---|---|
System.Object | A new object that is a copy of this instance. |
GetFormatType(Double)
Returns format type for a specified value.
Declaration
public ExcelFormatType GetFormatType(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Value to get format type for. |
Returns
Type | Description |
---|---|
ExcelFormatType | Format type for the specified value. |
GetFormatType(String)
Returns format type for a specified value.
Declaration
public ExcelFormatType GetFormatType(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | Value to get format type for. |
Returns
Type | Description |
---|---|
ExcelFormatType | Format type for the specified value. |