Pardon the n00b question!
I am trying to do some simple math in solidity using USD values.
For example, say the start price of a token offering is $0.50 USD and the contribution is $10.00 USD, then the number of tokens issued should be 20 tokens.
I am having trouble with the numbers with solidity.
Since Solidity doesn't use decimal places, I was assuming:
$0.50 USD would be represented as 0500000000000000000; //0.500000000000000000
$10.00 USD would be represented as 10000000000000000000; //10.000000000000000000000000
If I lead any unit values with zeros, Remix reports Expected primary expression.
as the error.
What's the best way to do math if you need to account for decimal places in Solidity?
I am not looking to way any ETH, WEI math, just USD math accounting for at least 4 decimal places.
Thank you in advance!!!