# Javascript: TableCellFormat.getNumberFormat Method

> Gets a number format for the table cell. The number format is used, when a formula is defined and the table cell's text is automatically calculated. When a number format is not defined, the property's value is an empty string. The number format string has a format as described in Office Open XML File Formats - ISO/IEC 29500 - 1, Chapter: 18.8.31 Number Formats.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: TableCellFormat.getNumberFormat Method
- **504 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecellformat/getnumberformat-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecellformat/getnumberformat-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecellformat/getnumberformat-method/llms-full.txt

---

### Description

Gets a number format for the table cell. The number format is used, when a formula is defined and the table cell's text is automatically calculated. When a number format is not defined, the property's value is an empty string. The number format string has a format as described in Office Open XML File Formats - ISO/IEC 29500 - 1, Chapter: 18.8.31 Number Formats.

### Syntax

```javascript
<void> TableCellFormat.getNumberFormat(<RequestNumberFormatCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the number format for the cell. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `TableCellFormat.getNumberFormat` in a practical document-editing workflow. It gets a number format for the table cell. The number format is used, when a formula is defined and the table cell's text is automatically calculated. When a number format is not defined, the property's value is an empty string. The number format string has a format as described in Office Open XML File Formats - ISO/IEC 29500 - 1, Chapter: 18.8.31 Number Formats.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function inspectNumberFormat(tableCellFormat) {
    tableCellFormat.getNumberFormat(
        function(result) {
            if (!result) {
                console.warn("No number format was returned.");
                return;
            }
            
            console.log("get number format result:", result);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: TableCellFormat.getBackColor Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecellformat/getbackcolor-method/llms-full.txt)
- **Next:** [Javascript: TableCellFormat.getTextType Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/tablecellformat/gettexttype-method/llms-full.txt)
