Solidity doesnt support decimal numbers thats why each token has their own decimal value as an erc20 or bep20 standard
1 eth for example has 18 decimals
So you would write it as 1e18
As per your comment regarding bnb/price = num of tokens
If youre calculating that for a swap on pancakeswap then you should call pancakeswap router function getAmountsOut which when supplied with correct paramters should return how many tokens out you get for the bnb you input
If not then lets say you set the price to be 2 bnb
Supposing 1 bnb has 8 decimals the formula would be
100000000/200000000
= 1/2 = invalid for solidity
But this is where decimals for tokens come in , if your token youre trying to get the number of has a decimal of 9
Then the number of tokens would be
1/2 * 1000000000.
That is equal to half a token
You can think of decimals as keeping count of cents for the dollar
A dollar has two cent digits
If you want to get 3 dollars in solidity its wrote as 3 * 10 ** 2
So 300 cents.
Its important to note when youre doing the calculating
(Bnb / price)*decimalsOfToken = tokens out
This is incorrect because you will get a decimal value before multiplying with decimalsOfToken which is invalid so the solution is to multiply bnb with decimalsOfToken and then dividing by price