Here is the code:
var negativeOdds = document.getElementById("negative").value;
var positiveOdds = document.getElementById("positive").value;
console.log(positiveOdds);
var positiveImplied = 100 / (positiveOdds + 100);
The result for var = positiveImplied is always something like 0.000843 when it's supposed to be around 0.454. I've tried countless of combinations with the parenthesis and it still gives me the same random answers. I console logged the positiveOdds variable to make sure it's getting the right info and it clearly is.
Anyone know what's up?
What I forgot to add is that it works perfectly fine in the other scenario:
var negativeOdds = document.getElementById("negative").value;
var positiveOdds = document.getElementById("positive").value;
console.log(positiveOdds);
var positiveImplied = (100) / (positiveOdds + 100);
var negativeImplied = (-(negativeOdds))/((-(negativeOdds)) + 100);
Works fine for negativeImplied, doesn't work at all for positive.
Edit: Works fine with parseInt. But still I don't understand how I don't have to use parseInt for negativeImplied, but have to for positiveImplied.