javascript:
var Value1 = prompt("Value? ", "");
var Value2 = (Value1+0.00003);
var Value3 = (Value1+0.00002);
console.log("Value 1 = " + Value1);
console.log("Value 2 = " + Value2);
console.log("Value 3 = " + Value3);
This just adds 0.0003 at the end of Value1, instead of doing the math. However, when I don't prompt for Value1, but give it a value myself, it all works as it should.
Eg: prompt for Value1 --> 0.8 --> Value2 becomes 0.80.00003 instead of 0.80003.
What should I change to the code?
EDIT:
By adding "Number" as suggested, Values get treated correctly, but the ouytput is not as expected:
Value 1 = 0.8
Value 2 = 0.80003
Value 3 = 0.8000200000000001
why is this?