i'm not expert in decimal to binary conversion. For my current project i have to develop a tool for decimal to binary conversion. Luckily i found the code on stackoverflow for the conversion. But, when i add more then 16 numbers, i get wrong answer. I checked a few tools and all tools are showing different answers but their answers are close to one another. i need help. My answers are nowhere near to the answers shown by the following tools.
https://binarytotext.net/decimal-to-binary/ & https://www.rapidtables.com/convert/number/decimal-to-binary.html https://www.binaryhexconverter.com/decimal-to-binary-converter
I would appreciate any help.
The code i found on stackoverflow:
var xx = document.getElementById("input").value;
var xy = parseInt(xx);
var xz = xy.toString(2);
document.getElementById("demo").innerHTML = xz;