Skip to content

Conversation

@tom2drum
Copy link
Collaborator

Description and Related Issue(s)

Resolves #3135

This PR implements a unified value display system that shows values with more than 8 zeros after the decimal point as < 0.001 (or similar based on accuracy) with the full amount displayed in a tooltip. This change improves readability for very small values across the entire application.

Proposed Changes

  • Refactored value components: Created a new modular value component system with specialized components:
    • NativeCoinValue - for native currency values with support for wei/gwei/ether units
    • TokenValue - for ERC-20 token values
    • GasPriceValue - for gas price values
    • AssetValue - base component for asset values with USD conversion support
    • SimpleValue - basic value display component
  • Removed deprecated components: Deleted CurrencyValue, getCurrencyValue, and getValueWithUnit utilities
  • Renamed component: TruncatedValueTruncatedText for better semantic clarity
  • Updated value display logic: Implemented consistent formatting that displays < 0.001 (or < 0.00000001 for 8 decimal accuracy) when a value rounds to zero but is not actually zero, with the full value available in tooltip
  • Applied changes across 130+ files: Updated all value displays throughout the application including:
    • Address pages (transactions, token transfers, internal transactions, coin balance history, tokens)
    • Token pages (transfers, holders)
    • Transaction pages (token transfers, internal transactions, user ops, fees)
    • Transaction lists and tables
    • Advanced filters
    • Withdrawals pages
    • Home page latest transactions
    • Blocks page (burnt fees)
    • And many more locations
  • Added showcase: Created Values.tsx showcase component demonstrating the new value components

Breaking or Incompatible Changes

No breaking changes. The new components maintain the same API surface as the previous value display utilities, ensuring backward compatibility.

Additional Information

The implementation uses a centralized formatting function (formatBnValue) that checks if a value rounds to zero when formatted with the specified accuracy. If the value is not actually zero, it displays the threshold format (e.g., < 0.001) while preserving the full precision value in the tooltip for user reference.

Checklist for PR author

  • I have tested these changes locally.
  • I added tests to cover any new functionality, following this guide
  • Whenever I fix a bug, I include a regression test to ensure that the bug does not reappear silently.
  • If I have added, changed, renamed, or removed an environment variable
    • I updated the list of environment variables in the documentation
    • I made the necessary changes to the validator script according to the guide
    • I added "ENVs" label to this pull request

@tom2drum tom2drum requested a review from isstuev November 26, 2025 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change zero to <0.001 value within different pages

2 participants