UNPKG
@ilihub/decimal-to-hexadecimal
Version:
latest (1.0.7)
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
Decimal to hexadecimal converter TypeScript library
code.ilihub.tech
ilihub/npm
@ilihub/decimal-to-hexadecimal
/
dist
/
index.js
6 lines
(3 loc)
•
223 B
JavaScript
View Raw
1
2
3
4
5
6
'use strict'
;
function
o
(
e
){
if
(e<
0
||!
Number
.
isInteger
(e))
return
""
;
let
t=
""
,r=e;
for
(;r>
0
;){
let
n=r%
16
;t=(n<
10
?n.
toString
():
String
.
fromCharCode
(
55
+n))+t,r=
Math
.
floor
(r/
16
);}
return
t||
"0"
}
exports
.
DecimalToHexadecimal
= o;