Languages
[Edit]
EN

JavaScript - convert int to hex

8 points
Created by:
Dexter
510

In this short article, we would like to show how to convert integer numbers to hexadecimal numbers (hex numbers) using JavaScript.

Quick solution:

// ONLINE-RUNNER:browser;

var intNumber = 26085;
var hexNumber = intNumber.toString(16);  // hex number as string

console.log(hexNumber); // 65e5

See also

  1. JavaScript - convert decimal number to bin, oct, hex, etc. (to any base system) 

Alternative titles

  1. JavaScript - convert int to hexadecimal
  2. JavaScript - convert dec to hex
  3. JavaScript - convert decimal to hexadecimal
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

JavaScript conversion

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join