Ethereum Denominations
There are 11 ways to divide an ether into other units.
- Wei is the lowest value unit, followed in identical order by Kwei, Mwei, Gwei, Szabo, Finney, Ether, KEther, MEther, GEther, and ultimately TEther.
- The distance between each unit and the unit next to it is 1^3 (or 3 decimals).
- As a result, 1 Wei is equal to 1000 times Kwei, 1 Kwei is equal to 1,000 Mwei, One Mwei is equal to 1,000 Gwei, and so on.
Unit | Denominations | |
---|---|---|
Wei | 1 | 1 |
Kwei | 1,000 | 10^3 |
Mwei | 1,000,000 | 10^6 |
Gwei | 1,000,000,000 | 10^9 |
Szabo | 1,000,000,000,000 | 10^12 |
Finney | 1,000,000,000,000,000 | 10^15 |
Ether | 1,000,000,000,000,000,000 | 10^18 |
KEther | 1,000,000,000,000,000,000,000 | 10^24 |
MEther | 1,000,000,000,000,000,000,000,000 | 10^24 |
GEther | 1,000,000,000,000,000,000,000,000,000 | 10^27 |
TEther | 1,000,000,000,000,000,000,000,000,000,000 | 10^30 |
We have deployed the smart contract to check the Ethereum Units value is correct or not.
Solidity
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; /// @title A contract for different units used in Ethereum /// @author Jitendra Kumar /// @notice For now, this contract just show the Ethereum uints value correct or not contract GFG { //Initialize the variable value bool oneWeiEqualTo=(1 wei == 1); string res1= "1 wei is equal to 1 wei" ; bool oneGWeiEqualTo=(1 gwei == 10**9); string res2= "1 gwei is equal to 10**9 (1e9) wei" ; bool oneEtherEqualTo=(1 ether == 10**18); string res3= "1 ether is equal to 10**18 (1e18) wei" ; //Create the function to check the unit value is correct or not function weiUnit() public view returns(string memory){ if (oneWeiEqualTo){ return res1; } return "Ethereum unit value is wrong!" ; } function gweiUnit() public view returns(string memory){ if (oneGWeiEqualTo){ return res2; } return "Ethereum unit value is wrong!" ; } function etherUnit() public view returns(string memory){ if (oneEtherEqualTo){ return res3; } return "Ethereum unit value is wrong!" ; } } |
So, follow these steps to execute the above solidity smart contract:-
1. Open Remix IDE.
2. Make a file with .sol extension and paste the given solidity code.
3. Select the same Compiler version which is used in solidity code before clicking on Compile button.
4. Click on Deploy button and get the deployed contract address.
5. Click on deployed contract address to get the result.
What are the Different Units Used in Ethereum?
This article will discuss what a Denominated Currency is, multiple Bitcoin Units, BTC Denominations, Ethereum Denominations: Ether to Wei, Gwei to Ether, and More Altcoin Crypto Names and Denominations, and lastly the differences between Fiat and Crypto Denominations. Let’s discuss these topics in detail.