# Javascript: TableCellFormat.getTextType Method

> Gets the text type of the table cell which determines whether the cell's text is interpreted as a number or as text When the type is Text, the cell's text is interpreted as text and it is displayed as it is. When the type is Number, the cell's text is interpreted as a number. The period character (.) is defined as decimal separator, the comma character (,) is defined as thousands separator.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TableCellFormat.getTextType Method
- **512 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tablecellformat/gettexttype-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tablecellformat/gettexttype-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/tablecellformat/gettexttype-method/llms-full.txt

---

### Description

Gets the text type of the table cell which determines whether the cell's text is interpreted as a number or as text When the type is Text, the cell's text is interpreted as text and it is displayed as it is. When the type is Number, the cell's text is interpreted as a number. The period character (.) is defined as decimal separator, the comma character (,) is defined as thousands separator.

### Syntax

```javascript
<void> TableCellFormat.getTextType(<RequestTextTypeCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the cell's set text type. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `TableCellFormat.getTextType` in a practical document-editing workflow. It gets the text type of the table cell which determines whether the cell's text is interpreted as a number or as text When the type is Text, the cell's text is interpreted as text and it is displayed as it is. When the type is Number, the cell's text is interpreted as a number. The period character (.) is defined as decimal separator, the comma character (,) is defined as thousands separator.

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

function inspectTextType(tableCellFormat) {
    tableCellFormat.getTextType(
        function(textType) {
            if (!textType) {
                console.warn("No text type was returned.");
                return;
            }
            
            console.log("get text type result:", textType);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: TableCellFormat.getNumberFormat Method](https://docs.textcontrol.com/ds-server/reference/javascript/tablecellformat/getnumberformat-method/llms-full.txt)
- **Next:** [Javascript: TableCellFormat.getVerticalAlignment Method](https://docs.textcontrol.com/ds-server/reference/javascript/tablecellformat/getverticalalignment-method/llms-full.txt)
