Per the comments, the issue was that obj.mem1.val1
was being passed to the calculation as a string, resulting in ('90' + 15) * (0.5343543)
or more likely ('90' + 1) * (0.5343543)
. Casting it to a number corrects the issue. This may be done like so:
Math.floor((+obj.mem1.val1 + i) * (obj.mem2[param][j].val2))
or
Math.floor((Number(obj.mem1.val1) + i) * (obj.mem2[param][j].val2))
and a few other ways.
solved Javascript equation producing incorrect value