EN
TypeScript - convert int to hex
0 points
In this short article, we would like to show how to convert integer numbers to hexadecimal numbers (hex numbers) using TypeScript.
Quick solution:
xxxxxxxxxx
1
const intNumber: number = 26085;
2
const hexNumber: string = intNumber.toString(16); // hex number as string
3
4
console.log(hexNumber); // 65e5
Output:
xxxxxxxxxx
1
65e5