函数 hex #

将数字格式化为十六进制。

Syntax #

math.hex(value)

Parameters #

Parameter Type Description
value number | BigNumber 要转换为字符串的值
wordSize number | BigNumber 可选的字大小(参见 format

Returns #

Type Description
string 格式化后的值

Throws #

Type | Description —- | ———–

Examples #

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

另请参阅 #

oct, bin

Fork me on GitHub