Converts a Decimal number to an Octal number as text.

**dec2oct**( *value*, [*place*] )

*value*: (Text) Decimal value to convert, such as 123.

*place*: (Number) The number of places to return.

Text

Negative number values for *value* are handled using the 2's complement method.

The default value for *place* is however many places are necessary to represent the number.

You can experiment with this function in the test box below.

Test Input

`dec2oct(16)`

returns `20`

Open in Github

On This Page