# barcodeCheckDigit Function

> barcodeCheckDigit function in the TX Sheet Control JavaScript API for the browser, with its syntax and a JavaScript example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Function
- **Path:** TX Sheet Control > API Reference > JavaScript API > Browser Editor > barcodeCheckDigit Function
- **171 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/barcodecheckdigit-function/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/barcodecheckdigit-function/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/barcodecheckdigit-function/llms-full.txt

---

Returns the GS1 modulo-10 check digit for a nonempty numeric body. Invalid bodies reject with an error.

Package: `@txtextcontrol/tx-sheet-control`.

### Syntax

```javascript
barcodeCheckDigit(body);
```

### Example

Use an existing workbook as `book`.

```javascript
const result = barcodeCheckDigit('590123412345');
```

### Remarks

Pass only the numeric body, without its existing check digit. The function returns one digit as a string and rejects blank or nonnumeric bodies. It does not read workbook cells.

See [Barcodes and QR Codes](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/barcodes/llms-full.txt) for supported payloads, quiet zones and examples.

---

## Nearby

- **Previous:** [renderBarcodePNG Function](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/renderbarcodepng-function/llms-full.txt)
- **Next:** [PivotTable](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/pivottable/llms-full.txt)
