Formualizer Docs

DEC2OCT

Converts a decimal integer to octal text.

Optionally pads the result with leading zeros using places.

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

=DEC2OCT(number, [places])

Arguments

ArgumentTypeRequiredDefault
numbernumberRequired—
placesnumberOptional—

Return type

Can return text.

Remarks

  • number is coerced to an integer and must be in [-2^29, 2^29 - 1].
  • Negative values are returned as 10-digit two's-complement octal strings.
  • places must be at least the output width and at most 10, or #NUM! is returned.

Examples

Convert a decimal integer using the shortest output.

Formula =DEC2OCT(30)

Expected result 36

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Request eight characters to see the leading-zero padding.

Formula =DEC2OCT(30,8)

Expected result 00000036

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Convert a negative value to its signed representation.

Formula =DEC2OCT(-1)

Expected result 7777777777

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

A nonzero value cannot fit in a zero-place output.

Formula =DEC2OCT(30,0)

Expected result #NUM!

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Convert decimal to octal

Formula =DEC2OCT(64)

Expected result 100

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

FAQ

What range does DEC2OCT support?

number must be in [-2^29, 2^29 - 1]; outside that range returns #NUM!.

Implementation

Engine source

On this page