Skip to main content

Try it Live

Run Denomination examples in the interactive playground
Conceptual Guide - For API reference and method documentation, see Denomination API.
Ethereum uses multiple denominations to represent value at different scales. This guide teaches denomination fundamentals using Tevm.

What are Denominations?

Denominations are units of value in Ethereum. All values are internally stored as Wei (the smallest unit), but expressed in different units for readability:
  • Wei - Base unit for precise calculations (like cents)
  • Gwei - Gas price unit (like dollars)
  • Ether - User-facing unit (like thousands of dollars)

The Three Units

Use Wei for: Internal calculations, smart contract values, precision

Conversion Scale

Understanding the relationships between units:

Converting Between Units

Complete Example: Gas Cost Calculation

Calculate total transaction cost from gas price and gas used:

Gas Price Examples

Formatting for Display

When displaying values to users, convert to appropriate units:

Common Use Cases

Precision Considerations

Type Safety

Tevm prevents accidental unit mixing at compile time:

Resources

Next Steps

  • Overview - Type definitions and API reference
  • Wei - Base unit operations
  • Gwei - Gas price unit
  • Ether - User-facing unit
  • Conversions - Converting between units