Skip to main content

BIN2DEC

Converts a binary number to decimal.

Syntax

expression.BIN2DEC(arg1);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe binary number which will be convertrd.

Returns

number

Example

This example shows how to convert a binary number to decimal.

// How to get a decimal representation of a binary number.

// Use function to convert a binary to decimal.

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.BIN2DEC(1110011100));