Pls consider the calculation in javascript code below. With example values:
- investmentfix = 200.00
- investmentvar = 123.12
- nrofparts = 5.00
...the console shows a strange result value 0200.00615.6. which I don't understand. I noticed the values 200.00 and 615.6, - the latter the result of investmentvar * nrofparts
- in this result value. But I'd expect (and target to get) the result 815.6 (200+(123.12*5.00).
What goes wrong? Does this relate to a kind of format issue?
javascript code:
var result =0;
result += (investmentfix + (investmentvar * nrofparts));
console.log(result);