Skip to content

conversion-library / binaryToDecimal

Function: binaryToDecimal()

ts
function binaryToDecimal(str: string): number

binaryToDecimal

别名:twoToTen

Parameters

str: string

输入的二进制字符串

Returns

number

返回十进制数字

Example

ts
binaryToDecimal('1010') // 10

Defined in

lib/decimal-conversion/decimalAndBinary.ts:42