I need some help with my rouding script. I have started pretty much from scratch and have no idea if its correct or even close but I have been trying and have gotten to this point. i keep getting syntax errors and im not sure what is wrong. Here is what I got
let value=$1;
while [ magn=1;"$value">\(magn*10\); magn*=10 ]
do
let digit=( $value/magn )%10
if [ $digit >= 5 ]
then
$value+=( "10"-$digit )*$magn
else
$value-=( $digit*$magn )
fi
done
echo $value
its supposed to take ./rounders 1447
and output 2000
I posted this in the OS sub forum also. NOOB mistake i know but hey its my first day. SOrry
very cool. Thanks, I will play with it some more and try to get it to work. If i need more help I will post here again. Thanks so much, I was already getting frustrated.