You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/developers/tutorials/a-developers-guide-to-ethereum-part-one/index.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -124,7 +124,7 @@ In [1]: from web3 import Web3
124
124
125
125
Besides being a gateway to Ethereum, the [Web3](https://web3py.readthedocs.io/en/stable/overview.html#base-api) module offers a few convenience functions. Let’s explore a couple.
126
126
127
-
In an Ethereum application, you will commonly need to convert currency denominations. The Web3 module provides a couple of helper methods just for this: [fromWei](https://web3py.readthedocs.io/en/stable/web3.main.html#web3.Web3.fromWei) and [toWei](https://web3py.readthedocs.io/en/stable/web3.main.html#web3.Web3.toWei).
127
+
In an Ethereum application, you will commonly need to convert currency denominations. The Web3 module provides a couple of helper methods just for this: [from_wei](https://web3py.readthedocs.io/en/stable/web3.main.html#web3.Web3.from_wei) and [to_wei](https://web3py.readthedocs.io/en/stable/web3.main.html#web3.Web3.to_wei).
128
128
129
129
<divclass="featured">
130
130
Note: Computers are notoriously bad at handling decimal math. To get around this, developers often store dollar amounts in cents. For example, an item with a price of $5.99 may be stored in the database as 599.
@@ -140,10 +140,10 @@ A similar pattern is used when handling transactions in <b>ether</b>. However, i
140
140
Try converting some values to and from wei. Note that [there are names for many of the denominations](https://web3py.readthedocs.io/en/stable/examples.html#converting-currency-denominations) in between ether and wei. One of the better known among them is **gwei**, as it’s often how transaction fees are represented.
That’s a lot of zeros! Before you go laughing all the way to the fake bank, recall that lesson about currency denominations from earlier. Ether values are represented in the smallest denomination, wei. Convert that to ether:
212
212
213
213
```python
214
-
In [8]: w3.fromWei(1000000000000000000000000, 'ether')
214
+
In [8]: w3.from_wei(1000000000000000000000000, 'ether')
215
215
Out[8]: Decimal('1000000')
216
216
```
217
217
@@ -246,7 +246,7 @@ We’re stuck at block zero until there’s a pending transaction, so let’s gi
0 commit comments