# DEC2HEX Function

> Convert a decimal number to hexadecimal text with DEC2HEX in TX Sheet Control: the valid range, two's complement for negatives, places and errors.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Function
- **Path:** TX Sheet Control > API Reference > Formula Functions > DEC2HEX Function
- **213 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/dec2hex/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/dec2hex/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/dec2hex/llms-full.txt

---

Convert a decimal number to a hexadecimal number. `number` is an integer from -549,755,813,888 to 549,755,813,887; decimals are truncated. A negative number returns ten hexadecimal digits in two's-complement notation. `places` pads the result with leading zeros to that number of characters. A number out of range or too few places returns `#NUM!`, and text that is not a number returns `#VALUE!`.

### Syntax

```text
DEC2HEX(number, places)
```

Category: Engineering. Minimum arguments: 1. Maximum arguments: 2.

Available for supported offline calculation.

### Examples

```text
=DEC2HEX(10)
```

The formula returns the text A.

Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.

### See Also

- [Formulas](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/formulas/llms-full.txt)
- [Custom Functions and Formula Data](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/custom-functions/llms-full.txt)

---

## Nearby

- **Previous:** [DEC2BIN Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/dec2bin/llms-full.txt)
- **Next:** [DEC2OCT Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/dec2oct/llms-full.txt)
