Lesson 4: Remix Fund Me decimals issue #1533
Unanswered
anonfawkes73
asked this question in
Q&A
Replies: 1 comment
-
Hey Let me try to answer your doubts.
Hope that answers your Question @anonfawkes73 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey guys, I've seen many questions regarding this part of the video but nobody is asking that, so I'm probably lost about something.
I'm a bit lost on that part (around 4:20 on the video).
getPrice();
is giving us a uint256 with 18 decimals, and that's ok.uint256 ethAmount
doesn't have 18 explicit decimals, so I don't understand why he says thatuint256 ethAmountInUSD = (ethPrice * ethAmount) / 1e18
is giving us a rounded number without any decimals, why does he say that it is giving us a number with 21 decimals// 2 * 1e21 = 3000_000000000000000000
?and why after he multiplies
uint256 public minimumUsd = 50 * **1e18**; // 1 * 10 ** 18
Beta Was this translation helpful? Give feedback.
All reactions