Wild guess here, but I'm assuming you are using javascript. Doing + like that in a loosely typed language will result in the language guessing what data type it is. Since the user input is a string (there is not input type=integer), it is going with a string for '150'. Thus it concatenates the string and the value of (20*5) which it takes as integers, making the '150' + '100' be '150100'.
Look up how to force a variable to be casted as a specific data type, and force the user input into be numeric, be it integers (whole numbers) or floating points (has decimals).
CypherJF - Thu Nov 01, 2007 8:50 pm
Post subject:
Good learning resource -
http://www.w3schools.com/
Cheese - Thu Nov 01, 2007 9:16 pm
Post subject:
i have it bookmarked already ;D
Cheese - Fri Nov 02, 2007 12:56 am
Post subject:
pretty sure its either the (- or the ^(
problems suck =(
Cheese - Fri Nov 02, 2007 1:41 am
Post subject:
i expanded it into
a=y-t
b= (-a)/400
c=1+pow(10,b)
p=1/c
w=y+(50*(1-p))
l=y+(50*(0-p))
|
but then it says object expected on the pow() line