---
title: toByte
framework: CKTool JS
role: symbol
role_heading: Type Method
platforms: [cktool js 1.2.15+]
path: cktooljs/cktooldatabasemodule/tobyte
---

# toByte

Converts a numeric value to a Byte.

## Declaration

```data
static Byte toByte();
```

## Parameters

- `value`: A numeric value to convert or validate.

## Return Value

Return Value If the value passes validation, this function returns a Byte; otherwise it throws ValueNotByteError. A numeric value passes validation if it’s an integer in the range 0 to 255, inclusive.

## Discussion

Discussion In TypeScript, Byte is a branded number type. In JavaScript, it’s a number. import { toByte } from "@apple/cktool.database";
