OCT2HEX function

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

Number

Text or { Text }

An octal number.

DigitCount

Number or { Number } (optional)

The number of digits to return. If omitted, the minimum number of digits necessary to accurately represent the number is used.

Returns

Text or { Text }

A hexadecimal number.

Converts an octal number to a hexadecimal number. 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" }.