I bought XXX amount of shares, but I got YYY amount of shares. Why?

If you do not have adequate cash and/or buying power, then the number of shares will be adjusted to allow the trade to be filled as best it can.