Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

hex to decimal formula javascript

const hexToDecimal = hex => parseInt(hex, 16);

const dec1 = hexToDecimal("2");
const dec2 = hexToDecimal("35");
const dec3 = hexToDecimal("1f4");
const dec4 = hexToDecimal("7b2");
const dec5 = hexToDecimal("123abc");

console.log(dec1); // 2
console.log(dec2); // 53
console.log(dec3); // 500
console.log(dec4); // 1970
console.log(dec5); // 1194684
Source by sabe.io #
 
PREVIOUS NEXT
Tagged: #hex #decimal #formula #javascript
ADD COMMENT
Topic
Name
6+4 =