# SpreadsheetNumberFormatSyntax

Lossless, non-regex syntax model for Excel-style number formats.

Class 

`OfficeIMO.Spreadsheet`

**Namespace**

`OfficeIMO.Spreadsheet`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[SpreadsheetNumberFormatSyntax.cs:109](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Spreadsheet/SpreadsheetNumberFormatSyntax.cs#L109)

**Modifiers**

sealed

Lossless, non-regex syntax model for Excel-style number formats. It distinguishes display literals from scaling operators and exposes the conservative common subset used by format adapters.

## Inheritance

- object
- SpreadsheetNumberFormatSyntax

## Usage

Explore 1 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 1

- Method [SpreadsheetNumberFormatSyntax.Parse](/api/core/officeimo-spreadsheet-spreadsheetnumberformatsyntax/#method-parse-string)

Filter members 

Show inherited

## Methods

`public static SpreadsheetNumberFormatSyntax Parse(string format)` [#](#method-parse-string)

[SpreadsheetNumberFormatSyntax.cs:109](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Spreadsheet/SpreadsheetNumberFormatSyntax.cs#L109)

Parses a number format while retaining every authored character.

Parameters

**format string required**

Returns

`SpreadsheetNumberFormatSyntax`

## 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 Text { get; }` [#](#property-text)

[SpreadsheetNumberFormatSyntax.cs:74](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Spreadsheet/SpreadsheetNumberFormatSyntax.cs#L74)

Exact authored format.

`public IReadOnlyList<SpreadsheetNumberFormatToken> Tokens { get; }` [#](#property-tokens)

[SpreadsheetNumberFormatSyntax.cs:76](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Spreadsheet/SpreadsheetNumberFormatSyntax.cs#L76)

Ordered lossless tokens.

`public bool IsValid { get; }` [#](#property-isvalid)

[SpreadsheetNumberFormatSyntax.cs:78](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Spreadsheet/SpreadsheetNumberFormatSyntax.cs#L78)

Whether all quoted and bracketed regions were terminated.

`public int SectionCount { get; }` [#](#property-sectioncount)

[SpreadsheetNumberFormatSyntax.cs:80](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Spreadsheet/SpreadsheetNumberFormatSyntax.cs#L80)

Number of authored format sections.

`public bool IsPercentage { get; }` [#](#property-ispercentage)

[SpreadsheetNumberFormatSyntax.cs:82](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Spreadsheet/SpreadsheetNumberFormatSyntax.cs#L82)

Whether the first section contains an unquoted percentage-scaling operator.

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

[SpreadsheetNumberFormatSyntax.cs:84](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Spreadsheet/SpreadsheetNumberFormatSyntax.cs#L84)

First currency symbol or code in the first section.

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

[SpreadsheetNumberFormatSyntax.cs:87](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Spreadsheet/SpreadsheetNumberFormatSyntax.cs#L87)

Whether the first section requests thousands grouping.

`public int ScaleThousands { get; }` [#](#property-scalethousands)

[SpreadsheetNumberFormatSyntax.cs:89](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Spreadsheet/SpreadsheetNumberFormatSyntax.cs#L89)

Number of first-section commas that scale the displayed value by one thousand.

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

[SpreadsheetNumberFormatSyntax.cs:93](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Spreadsheet/SpreadsheetNumberFormatSyntax.cs#L93)

Digit placeholders following the first decimal separator in the first section.

<!-- PowerForge markdown artifact sha256:128E335F92EC04778349DD744285FC55D11A39EA76D3A8F42CB6F61CBF1C47A5 -->
