UNPKG
charset-pl
Version:
latest (2.0.0)
2.0.0
1.0.0
0.4.0
0.3.0
0.2.1
0.2.0
0.1.1
0.1.0
0.0.1
polish charset? idk
charset-pl
/
lib
/
tools
/
toBinary.ts
8 lines
(7 loc)
•
139 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
export
default
function
toBinary
(
n
:
number
,
d
:
number
) {
var
b = n.
toString
(
2
)
while
(b.
length
< d) { b =
'0'
+ b }
return
b }