Use the % operator.
long bignum = 2844493234;int smallernum = bignum % 1000000;
Where are you getting this number? Why are you only interested in the last 6 digits? What if the number is only a 3 digit number?
So by using % (modulo) it divides the number until it can't be divided any more then returns the remainder
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16