# OdsDataStyle

An XML-backed ODS number, percentage, currency, date, or time style.

Class 

`OfficeIMO.OpenDocument`

**Namespace**

`OfficeIMO.OpenDocument`

**Assembly**

`OfficeIMO.OpenDocument`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[OdsDataStyle.cs:47](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsDataStyle.cs#L47)

**Modifiers**

sealed

An XML-backed ODS number, percentage, currency, date, or time style.

## Inheritance

- object
- OdsDataStyle

## Usage

Explore 6 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 6

- Method [OdsDocument.AddCurrencyStyle](/api/open-document/officeimo-opendocument-odsdocument/#method-addcurrencystyle-string-string-int32-boolean)
- Method [OdsDocument.AddDateStyle](/api/open-document/officeimo-opendocument-odsdocument/#method-adddatestyle-string)
- Method [OdsDocument.AddNumberStyle](/api/open-document/officeimo-opendocument-odsdocument/#method-addnumberstyle-string-int32-boolean)
- Method [OdsDocument.AddPercentageStyle](/api/open-document/officeimo-opendocument-odsdocument/#method-addpercentagestyle-string-int32-boolean)
- Method [OdsDocument.AddTimeStyle](/api/open-document/officeimo-opendocument-odsdocument/#method-addtimestyle-string)
- Property [OdsDocument.DataStyles](/api/open-document/officeimo-opendocument-odsdocument/#property-datastyles)

Filter members 

Show inherited

## Methods

`public string ToExcelNumberFormatCode()` [#](#method-toexcelnumberformatcode)

[OdsDataStyle.cs:47](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsDataStyle.cs#L47)

Projects the represented common ODF style to an Excel number-format code.

Returns

`string`

Exceptions

- `InvalidOperationException` – The style cannot be represented within Excel's custom-format limit.

`public bool TryGetExcelNumberFormatCode(out string formatCode)` [#](#method-trygetexcelnumberformatcode-string)

[OdsDataStyle.cs:54](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsDataStyle.cs#L54)

Attempts to project the represented common ODF style to a bounded Excel number-format code.

Parameters

**formatCode string required**

Returns

`bool`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public string Name { get; }` [#](#property-name)

[OdsDataStyle.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsDataStyle.cs#L25)

Style name referenced by a cell style.

`public OdsDataStyleKind Kind { get; }` [#](#property-kind)

[OdsDataStyle.cs:27](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsDataStyle.cs#L27)

Data style kind.

`public int DecimalPlaces { get; }` [#](#property-decimalplaces)

[OdsDataStyle.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsDataStyle.cs#L29)

Configured decimal places, or zero when the style has no decimal number component.

`public int MinimumIntegerDigits { get; }` [#](#property-minimumintegerdigits)

[OdsDataStyle.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsDataStyle.cs#L32)

Minimum integer digits requested by the number component.

`public bool UsesGrouping { get; }` [#](#property-usesgrouping)

[OdsDataStyle.cs:36](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsDataStyle.cs#L36)

Whether the style requests grouped thousands.

`public string? CurrencySymbol { get; }` [#](#property-currencysymbol)

[OdsDataStyle.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsDataStyle.cs#L40)

Visible currency symbol or code, when present.

## Fields

`public const int MaximumExcelNumberFormatCodeLength` [#](#field-maximumexcelnumberformatcodelength)

[OdsDataStyle.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Spreadsheet/OdsDataStyle.cs#L20)

Maximum number of characters supported by an Excel custom number-format code.

Value: `255`

<!-- PowerForge markdown artifact sha256:CFBC654E23E54A5041DE81130D671D081A842DF7F63A6667DA8D2889FD6A537F -->
