DEC2OCT function

DEC2OCT(Number, DigitCount?) DEC2OCT(Number; DigitCount?)

Number

Number or { Number }

A decimal 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 }

An octal number.

Converts a decimal number to an octal number. Also consider using the more general function BASE. Perform the reverse conversion using OCT2DEC.

Examples

DEC2OCT(5)DEC2OCT(5)

Returns "5".

DEC2OCT(5, 4)DEC2OCT(5; 4)

Returns "0005".

DEC2OCT(123)DEC2OCT(123)

Returns "173".

BASE(123, 8)BASE(123; 8)

Returns "173".

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

Returns the array { "5", "173" }{ "5"; "173" }.