Well, I'm trying to make something simple, but for some reason I'm getting it wrong, and I believe it could be something very simple.
What I want to do?
I want every transaction from my 1% token to be redirected to an X wallet.
In simple math, this would be something:
(1/100) * 12000 = 12
However I am working with values in WEI format in my ERC20 contract, so I did something similar like this...
uint256 tokens = weiAmount.mul(rate); //this moment is have 12000000000000000000000 Or 12000 uint256 private feesCashBack = 0.01 * 10 ** 18; //1% uint256 tokenBack = tokens.mul(feesCashBack);
RESPONSE IN WEI = 120000000000000000000000000000000000000 (value in WEI)
RESPONSE CONVERT WEI = 120000000000000000000
Why? What am I wrong?