2025-01-30 13:58:20 +01:00

1.1 KiB

layout
default

Function hex #

Format a number as hexadecimal.

Syntax #

math.hex(value)

Parameters #

Parameter Type Description
value number | BigNumber Value to be stringified
wordSize number | BigNumber Optional word size (see format)

Returns #

Type Description
string The formatted value

Throws #

Type Description

Examples #

math.hex(240) // returns "0xf0"

See also #

oct, bin