How to send numbers from one Arduino to another using Serial

When it's done the original way when I stream lets say the number 8000 it gets there as 8000. However when I use my code it's sometimes 800, sometimes 80 or even 8.