DEC2HEX (Number, DigitCount?) DEC2HEX (Number; DigitCount?)

Number

Number Number

A decimal number.

DigitCount

Number Number (optional)

The number of digits to return. If omitted, the minimum number of digits necessary to accurately represent the number is used. It is ignored for negative numbers.

Returns

Text Text

A hexadecimal number.

Converts a decimal number to a hexadecimal number. Negative numbers are written as ten digits in two's complement form. Also consider using the more general function BASE. Perform the reverse conversion using HEX2DEC.

Examples

DEC2HEX (5)
DEC2HEX (5)

Returns "5".

DEC2HEX (5, 4)
DEC2HEX (5; 4)

Returns "0005".

DEC2HEX (123)
DEC2HEX (123)

Returns "7B".

BASE (123, 16)
BASE (123; 16)

Returns "7B".

DEC2HEX ({ 5, 123 })
DEC2HEX ({ 5; 123 })

Returns the array { "5", "7B" }{ "5"; "7B" }.

DEC2HEX ( - 1)
DEC2HEX ( - 1)

Returns "FFFFFFFFFF", -1 in two's complement form.

fxEngine Shell Want this in your own terminal? A standalone version is coming. Get notified.
Loading fxEngine Shell