How can I get 1.3% value of an amount?

totalFee = (totalSupply.sub (minSupply)). mul (100) .div (totalSupply);

Rolls down when totalFee is decimal. When the pattern is 1.3 it is taken as 1.

How do I get it calculated as a decimal?

1 Like

I am not sure about the newest version, 0.8.0, of the solidity, but before this version, there is no decimals in the contract, so if you want to deal with it, maybe you can do like this:

actualAmount = rawAmount.mul(130).div(100);
2 Likes