OCT2HEX (octal number to hexadecimal number)

<< Click to Display Table of Contents >>

OCT2HEX (octal number to hexadecimal number)

Syntax:

OCT2HEX(Number [, Digits])

Description:

Converts the given octal number (base 8) to a hexadecimal number (base 16).

Number is the number to be converted.

Negative numbers have to be transformed to two's complement notation (see last example).

The permissible value range for Number is (in octal notation)

20000000000 ≤ Number ≤ 17777777777

This corresponds in decimal notation:

-2,147,483,648 ≤ Number ≤ 2,147,483,647

The optional argument Digits lets you specify the number of places to be displayed. If omitted, PlanMaker determines the number of required places automatically.

Digits must be greater than zero. Digits should be an integer. Digits to the right of the decimal point are ignored.

If Digits is smaller than the minimum number of places required to display the number, the function returns a #NUM error value.

If Number is negative, the result is represented in 32-bit two's complement; the Digits argument is ignored in this case.

Example:

OCT2HEX("52") returns 2A

OCT2HEX("0052") returns 2A as well

OCT2HEX("52", 1) returns the error value #NUM!, because this number cannot be represented with fewer than 2 hexadecimal digits

OCT2HEX("37777777726") returns FFFFFFD6 (negative value)

See also:

HEX2OCT, OCT2BIN, OCT2DEC