I need to store the IRR (internal rate of return) of a project in my smart contract.
Since Solidity can't store decimals it must be saved as an integer.
Which of these options would be better and why:
- Save only the return (in tokens) and calculate the rate/percentage outside the contract.
- Represent the percentage in the same way decimals on tokens are stored, i.e. by multiplying by 10 ** decimals().
Or is there a better way?