March 29th, 2002, 04:32 PM
Can someone please tell me why this:
pxl = parseInt(document.MM_Time.values[i-1] + tmp)
concatenates as opposed to adds? E.g. the left value is -100 (I've checked) and the value of tmp is 9, the result should be -91 but I get -1009
Any help greatly appreciated.
March 29th, 2002, 07:09 PM
Did you try:
If either of the values in the parentheses is a string, both will be concatenated before parseInt returns an integer value. This might work:
pxl = Number(document.MM_Time.values[i-1]) + tmp;
If tmp is a string, run that through the Number() constructor too.
March 30th, 2002, 04:38 AM
You the man!
Thanks a lot for your help.
It's working fine using the number constructor