I know that when you level up, the amount that goes up for each stat is 2% of the base stat, and 1% of EV and IV.
But when playing, the stats gained vary, like for example getting +1 for hp, and then getting +0.
Does it save past remainders, like if you get 1.5, you gain 1, and then have 0.5 left over, giving you +2 next time? But even then, how would you ever get 0?
The Pokemon this is happening too has a base stat of 80, and the nature makes it lose 10%. That makes it gain 1.44 at least, so how is it possible to gain 0?
Oh, and it can be higher than 1.44, cause I don't know the IV and EV.
Is there a Random number involved in the formula for stats gained when you gain a level?
And I am also wondering, what is LV.1 stats based on? How are they calculated?
Every time a Pokemon levels up or is generated (regardless of level it's generated at), the stats will be calculated by a specific formula for the stat. The previous value for the stat will be thrown out and remade with the new values for the relevant variables.
There are no random numbers in this process, the only perceived randomness is due to EVs and IVs, which are random unless you pay attention to them.
The full formula for calculating non-HP stats is this:
Stat = (((IV + 2 * BaseStat + (EV/4) ) * Level/100 ) + 5) * Nature Value.
The formula for HP is different, but it uses the same variables as the other stat formula (except nature, as nature doesn't affect HP).
HP = ( (IV + 2 * BaseStat + (EV/4) ) * Level/100 ) + 10 + Level
IV is a value from 0 to 31, determined at generation of Pokemon.
BaseStat is a value specific to each species, and you can find it on that species' Pokedex page on Serebii.
EV is a value from 0 to 252 (255 in earlier gens, but it would round down anyways) based on the wild Pokemon you've fought, both which kinds and how many.
Level is fairly simple, the level shown for the Pokemon.
Nature Value is how much the Nature of the Pokemon affects the stat. A Modest nature will provide a * 1.1 modifier to Special Attack, but also provide a * 0.9 modifier to Attack.
Every time the stats for a Pokemon change, the game refers back to this formula, regardless of what the previous stat was. The +0, +1, +2, etc. you see when a Pokemon levels up is determined by finding the difference between the old stat and the new one, and a +0 change simply means that the variables involved did not change enough to increase the stat's value.