Result: -1.#IND

1. JSNewbie Guest

## Result: -1.#IND

Looks like my previous post got buried - thanks to all!!<BR><BR>Now I am getting a result however the result is really strange and I am hoping someone will have seen this before. Here is the new improved version of the function: <BR>&#060;% <BR>function getTotals(rsname1, rsname2) { <BR>var total; <BR>rsname1.MoveFirst(); <BR>rsname2.MoveFirst(); <BR>while ((!rsname1.EOF) && (!rsname2.EOF)) { <BR>var num1 = (rsname1(&#039;TIMESPENT&#039;)); <BR>var num2 = (rsname2(&#039;INTHOURS&#039;)); <BR>total += (num1 / num2); <BR>rsname1.MoveNext(); rsname2.MoveNext(); <BR>} <BR>return total; <BR>} <BR>%&#062; <BR><BR>Now the screwy thing is the result I get is always -1.#IND <BR>Anyone have any words of wisdom for this? <BR><BR>Also - since I am new and have no clue, I tried changing the function to read:<BR><BR>total =+ (num1 / num2); <BR><BR>Just to see what would happen and it returned the last row only it did not add them all together as intended.<BR><BR>Thank you again!!

2. Senior Member
Join Date
Dec 1969
Posts
1,912

## RE: Result: -1.#IND

You are Trying to divide a string by another string, hence error!<BR><BR>total += (parseInt(num1) / parseInt(num2));

3. JSNewbie Guest

## RE: Result: -1.#IND

I tried that with parseFloat() since they are decimal numbers I am dealing with and I still get -1.#IND as the result. Can you think of anything else it might be?<BR><BR>Thanks!!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•