04-22-2006
3,
0
Join Date: Apr 2006
Last Activity: 22 April 2006, 6:24 PM EDT
Posts: 3
Thanks Given: 0
Thanked 0 Times in 0 Posts
help please
I need to multiply a number , howeveri am aware that there is a command to extend the variable? ,currently if my total goes over 250 my answer is wrong, script as below . thank you
mulfunc ()
{
# if the entered number is 0 or less , then answer 0
if [ $1 -le 0 ]
then
return 0
# otherwise X this by 100
else
RESULT=`expr $1 \* 10`
return $RESULT
fi
}
echo "the total is /n"
read TOTFAC
#call the function to perform calculation
mulfunc $TOTFAC
echo "the income from $TOTFAC is $? pounds
"