Skip to main content

OCT2BIN

Converts an octal number to binary.

Syntax

expression.OCT2BIN(arg1, arg2);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

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

Returns

number

Example

Convert an octal number to its binary representation in a spreadsheet.

// How do I change an octal value to binary in a spreadsheet?

// Transform a base-8 number into a base-2 format in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.OCT2BIN(7777777634));