if statement problem

Hi I have a bash script like this

if [ $1 -le 2279 ]
then
echo "A"
else
echo "B"
fi

$1 is something like 02350 (there is always a trailing '0')
and I would like to have an if based on the value of the digits after the 0.

Can anybody help?
Thanks,
Sarah

You can remove a leading 0 with:

var=$1
if [ ${var#0} -le 2279 ]

You can remove a trailing 0 with:

var=$1
if [ ${var%0} -le 2279 ]

To remove both:

var=${1#0}
if [ ${var%0} -le 2279 ]

You can force the parameter to be a number not a string.

num=$(($1 + 0))
if [ ${num} -le 2279 ]
then
echo "A"
else
echo "B"
fi

thank you it worked!