Skip to main content

DEC2OCT

Converts a decimal number to octal.

Syntax

expression.DEC2OCT(arg1, arg2);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberTe decimal integer to convert.
arg2OptionalApiRange | ApiName | numberThe number of characters to use.

Returns

number

Example

Convert numbers from base 10 to base 8 format in a spreadsheet.

// What is a decimal number expressed as octal in a spreadsheet?

// Transform your decimal numbers into their octal equivalents in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.DEC2OCT(-100));