OK, I find it a little weird about the issue I am having. I do not know why it is like this. I have to sum meter with centimeter and the result is not good.
Here are my HTML codes first:
The text box with the ID "met" is for meter and the one with ID "cen" is centimeter. Good!Code:<input type="number" id="met"/> <input type="number" id="cen"/>
I want to add both and the result must be in meter. So I have to convert the centimeter to meter and I did this:
Unfortunately, the result is not good. If I add 1 meter to 0.74 meter I get 10.74 and not 1.74 instead. Why? Thank!Code:var m = document.getElementById("met").value; var c = document.getElementById("cen").value; var con = c / 100; //Convert centimeter to meter var add = m + con; //Add both