I have the javascript equation:
var sbal=pfWeight-gWeight-adjm;
$("#result").html(sbal.toFixed(5));
If the result is 0, I assign the result the CSS color green. If it is not 0, I assign the result the CSS color red.
My problem is that sometimes the math comes out as -0 and thus displays as red.
I even tried
if(sbal===0){sbal=parseInt(0);}
sbal===0 returns true.
How can I work around this?
I know that Are +0 and -0 the same? addresses WHY -0 = +0 but it does not supply and answer on how to fix the problem.