bit.tohex Synchronous

Represent a 32-bit value as lowercase hexadecimal text. Use it to inspect masks, colors, or packed fields; the output has no 0x prefix or leading padding.

Syntax
Luau
bit.tohex(value: number, ...ignored: any) -> string

Parameters

Function parameters
ParameterTypeDescription
valuenumberNumeric value to convert.
...ignoredanyAdditional arguments are ignored. A width or padding argument is not implemented.

Returns

string

Unpadded lowercase hexadecimal text.

Differences from Volt

Volt documents its Bit Library setting as disabled by default. Kawaii enables bit by default. Disabling the setting removes the bit global and makes retained function references reject calls.

Availability

Bit is enabled by default. The bit global is removed when disabled, and its operations check the setting.

Example

Example
Luau
print(bit.tohex(0x0000000f)) -- f
print(bit.tohex(255)) -- ff
Kawaii documentation