Skip to content

conversion-library / decimalToBinary

Function: decimalToBinary()

ts
function decimalToBinary(num: number): string

decimalToBinary

别名:tenToTwo

Parameters

num: number

输入的十进制数字

Returns

string

返回二进制字符串

Example

ts
decimalToBinary(10) // '1010'

Defined in

lib/decimal-conversion/decimalAndBinary.ts:16