Replies: 1 comment 2 replies
-
Honestly, it won't help your learning process if anyone solves it and gives you the answer, so instead, I will urge you to go through the decimal manipulation exercise here |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
function convertUsdToEth(uint256 usdAmount, uint256 ethPrice) public view returns(uint256) {
ethPrice = getPrice();
uint256 usdAmountToEth = (usdAmount*10e31)/ethPrice;
return usdAmountToEth;
}
Beta Was this translation helpful? Give feedback.
All reactions