OCT2HEX (Number, DigitCount?) OCT2HEX (Number; DigitCount?)

Number

Text Text

An octal 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 an octal number to a hexadecimal number. Negative numbers are written as ten digits in two's complement form. Also consider using the more general functions BASE and DECIMAL. Perform the reverse conversion using HEX2OCT.

Examples

OCT2HEX ("5")
OCT2HEX ("5")

Returns "5".

OCT2HEX ("5", 4)
OCT2HEX ("5"; 4)

Returns "0005".

OCT2HEX ("173")
OCT2HEX ("173")

Returns "7B".

BASE ( DECIMAL ("173", 8), 16)
BASE ( DECIMAL ("173"; 8); 16)

Returns "7B".

OCT2HEX ({ "5", "173" })
OCT2HEX ({ "5"; "173" })

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

OCT2HEX ("7777777777")
OCT2HEX ("7777777777")

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