Try it Live
Run Denomination examples in the interactive playground
Ether
Primary user-facing Ethereum denomination, equal to 1 quintillion (10^18) Wei.Overview
Ether (ETH) is the native cryptocurrency of Ethereum.Ether.Type is a branded Uint256 preventing accidental unit mixing.
Common usage: Account balances, transaction values, user-facing amounts.
Type Definition
Construction
Ether.from(value)
Create Ether from numeric value.
value: bigint | number | string- Value to convert to Ether
Ether.Type
Note: Uses Uint.from internally for conversion.
Defined in: primitives/Denomination/Ether.ts:10
Conversions From Other Units
Ether.fromWei(wei)
Convert Wei to Ether (divide by 10^18).
wei: Wei.Type- Wei value
Ether.Type
Formula: ether = wei / 1_000_000_000_000_000_000 (integer division)
Defined in: primitives/Denomination/Ether.ts:14
Ether.fromGwei(gwei)
Convert Gwei to Ether (divide by 10^9).
gwei: Gwei.Type- Gwei value
Ether.Type
Formula: ether = gwei / 1_000_000_000 (integer division)
Defined in: primitives/Denomination/Ether.ts:19
Conversions To Other Units
Ether.toWei(ether)
Convert Ether to Wei (multiply by 10^18).
ether: Ether.Type- Ether value
Wei.Type
Formula: wei = ether * 1_000_000_000_000_000_000
Defined in: primitives/Denomination/Ether.ts:24
Ether.toGwei(ether)
Convert Ether to Gwei (multiply by 10^9).
ether: Ether.Type- Ether value
Gwei.Type
Formula: gwei = ether * 1_000_000_000
Defined in: primitives/Denomination/Ether.ts:29
Conversions To Base Type
Ether.toU256(ether)
Convert Ether to raw Uint256 (removes branding).
ether: Ether.Type- Ether value
Uint.Type
Note: Removes type safety. Use for arithmetic operations requiring Uint.Type.
Defined in: primitives/Denomination/Ether.ts:34
Usage Examples
Account Balance
Transaction Value
Balance Comparison
Total Value Calculation
Fractional Ether Display
Conversion Constants
Common Ether Values
Type Safety
Ether type prevents mixing with other denominations:Precision Considerations
Ether uses integer arithmetic. For fractional Ether:Display Best Practices
WASM Acceleration
Ether conversions available in WebAssembly for performance:Related
- Wei - Smallest denomination
- Gwei - Gas price denomination
- Conversions - Converting between units
- Usage Patterns - Common patterns
- Uint256 - Underlying numeric type

