MCPcopy Index your code
hub / github.com/TheAlgorithms/JavaScript / intToHex

Function intToHex

Conversions/DecimalToHex.js:1–17  ·  view source on GitHub ↗
(num)

Source from the content-addressed store, hash-verified

1function intToHex(num) {
2 switch (num) {
3 case 10:
4 return 'A'
5 case 11:
6 return 'B'
7 case 12:
8 return 'C'
9 case 13:
10 return 'D'
11 case 14:
12 return 'E'
13 case 15:
14 return 'F'
15 }
16 return num
17}
18
19function decimalToHex(num) {
20 const hexOut = []

Callers 1

decimalToHexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected