Want to develop a hexadecimal to decimal software

aaronsmith

New Member
Reaction score
2
Location
Daly City, CA
Hello,

I have worked in the computer networking company as a network engineer and recently i have started my business. Meanwhile, i have been working on my product for a couple of months. I'm developing a safebox with Raspberry-pie, i have used javascript(Node.js) for the development of my product. Everything seems perfect except one hexadecimal to decimal software creation.

I have very basic knowledge about software creation and implementation, I watch online tutorials and code but i could not find anything to convert the hex values in the decimal. If I could get an reference for the website then I would be really grateful!!
 
Hey,

Thanks for sharing this. I have got the basic understanding about it. I implemented this code and it works totally fine until i insert more then 15 hexadecimal or decimal numbers. For example, I'm going to deal with the MAC address which are described in the hexadecimal number. e.g: FE80:7D8C:ABC4:5EAAA:JK983. When i try to process this hex, the code above returns a wrong answer. I'm considering this tool & this one for the reference converter. They seem to be using the similar code and technique but their tool returns correct answer.
 
Ohh, Oh my god. Thsi is so simple, i just found solution on stackoverflow for the conversion. I just used bignumber.js for the conversion, and i'm getting corect answer now!!!

this is so cool . Thanks man for your help!!!
Cheers,

code:

var input = document.getElementById("text_value").value;
var x = new BigNumber(input, 16);
var dect = x.toString(10);
document.getElementById("ans").innerHTML = dect;
 
Back
Top