The decimals controls how many decimal digits will use your token. The amount of tokens are expressed with all the possible decimal digits. But usually wallets format them accordingly.
For example if you set decimals to cero your token has no decimal digits. The minimal unit is 1 token, and it cannot be split in smaller units. If the total supply is 1000 tokens, in the contract is stored as 1000.
If you set decimals to 2, then you can split 1 token into smaller units. The minimal unit is 0.01 token. If the total supply is 1000 tokens it is stored in the contract as 100009. The two extra ceros are because of the decimals.
A frequent value for decimals is 18 because that is what Ethereum uses for the ethers.