Solved

# Javascript subtraction help needed

Posted on 2007-03-31

I can't see to figure this one out... yet it seems so simple

when I calculate the following equation I am getting a very out results 5.21-5 = .2099999999999999998.

I need it to compute the actual value which is .2100000

function ComputeChange5(Start, Change, End) {

document.MainForm[Change].value = formatNum(eval(5.21-5),"^#,###.5^");

}

I am looking for a very simple solution... I apss into the function the start and end values, and then look for the change value (which is the subtraction). I tried to simplify the code above after I narrowed down that its not my passed in variables, its simply the calucation. thx.