Skip to content

conversion-library / decimalToOtherBase

Function: decimalToOtherBase()

ts
function decimalToOtherBase(num: number, base: number): string

decimalToOtherBase

别名:tenToOther

Parameters

num: number

输入的十进制数字

base: number

需要转换的进制

Returns

string

返回转换后的字符串

Example

ts
decimalToOtherBase(10, 2) // '1010'

Defined in

lib/decimal-conversion/decimalAndOtherBase.ts:19