DEC2OCT Function
The DEC2OCT
function in Google Sheets is used to convert a decimal number to its octal equivalent.
Syntax
DEC2OCT(decimal_number, [significant_digits])
- decimal_number: The decimal number you want to convert. This is a required parameter.
- significant_digits: (Optional) The number of digits you want the octal number to contain.
Examples
- Basic Conversion
Convert the decimal number 8
to octal:
=DEC2OCT(8)
This will output 10
.
- Conversion with Significant Digits
Convert the decimal number 7
to octal with 3 significant digits:
=DEC2OCT(7, 3)
This will output 007
.
Notes
- The function can handle decimal numbers from
-536,870,912
to536,870,911
. - If
significant_digits
is provided, the octal result will be padded with leading zeros to match the specified length.