comparing numbers
Posted: Wed Sep 18, 2002 4:30 am
eek!
I've never needed to do this so i've never thought about it, so bear with me if I'm talking crap.
How would I/or can I compare numbers
For example I have the number 4 in a variable and a second number ($newnumber) how would I check the value of $newnumber and output the difference
ie
$firstnumber = 4
$newnumber = 6
I want to get the output to be "+2" actually showing the plus sign, likewise if $newnumber had been 3 the output should show "-1"
Any help or a point in the right direction for further reading would be gratefully accepted thanks.
I've never needed to do this so i've never thought about it, so bear with me if I'm talking crap.
How would I/or can I compare numbers
For example I have the number 4 in a variable and a second number ($newnumber) how would I check the value of $newnumber and output the difference
ie
$firstnumber = 4
$newnumber = 6
I want to get the output to be "+2" actually showing the plus sign, likewise if $newnumber had been 3 the output should show "-1"
Any help or a point in the right direction for further reading would be gratefully accepted thanks.