Ive got to sum up 5 numbers.
125000+23500.75+5525725.79+3257500+63542.36
When summing these i should get the answer as 8995268.9
but im getting the answer as 8995268.899999

My script code is as follows
------------------------------------------
var totalDebit =0;
(here dtAmt[i] contains each of the above specified numbers)
for(i=0;i<5;i++){
if(!isEmpty(dtAmt[i].value)){
totalDebit =parseFloat(totalDebit) +parseFloat(dtAmt[i].value);
}
}

Ive got to sum up 5 numbers.
125000+23500.75+5525725.79+3257500+63542.36
When summing these i should get the answer as 8995268.9
but im getting the answer as 8995268.899999

My script code is as follows
------------------------------------------
var totalDebit =0;
(here dtAmt[i] contains each of the above specified numbers)
for(i=0;i<5;i++){
if(!isEmpty(dtAmt[i].value)){
totalDebit =parseFloat(totalDebit) +parseFloat(dtAmt[i].value);
}
}

Y do i get the anonymous answer.?

I will move this to the Javascript forum where it belongs and where you are likey to be told about how parseFloat approximates values ...

Ive got to sum up 5 numbers.
125000+23500.75+5525725.79+3257500+63542.36
When summing these i should get the answer as 8995268.9
but im getting the answer as 8995268.899999

My script code is as follows
------------------------------------------
var totalDebit =0;
(here dtAmt[i] contains each of the above specified numbers)
for(i=0;i<5;i++){
if(!isEmpty(dtAmt[i].value)){
totalDebit =parseFloat(totalDebit) +parseFloat(dtAmt[i].value);
}
}

Y do i get the anonymous answer.?

Use

Expand|Select|Wrap|Line Numbers

totalDebit.toFixed(1);

to round to one decimal place and yes, parseFloat is only approximate.