Skip to content
Bit operationsReference

bit.tohex

Format a number as eight lowercase hexadecimal digits.

Details#

Format a number as eight lowercase hexadecimal digits. Eight-character string, without a 0x prefix. There is no width argument.

Signature#

Luau
bit.tohex(value: number): string

Parameters#

ParameterTypeDescription
valuenumberNumber normalized to 32 bits.

Returns#

Eight-character string, without a 0x prefix. There is no width argument.

Examples#

Local example

Luau
print(bit.tohex(255)) -- 000000ff