Change zero to <0.001 value within different pages #3150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
NativeCoinValue- for native currency values with support for wei/gwei/ether unitsTokenValue- for ERC-20 token valuesGasPriceValue- for gas price valuesAssetValue- base component for asset values with USD conversion supportSimpleValue- basic value display componentCurrencyValue,getCurrencyValue, andgetValueWithUnitutilitiesTruncatedValue→TruncatedTextfor better semantic clarity< 0.001(or< 0.00000001for 8 decimal accuracy) when a value rounds to zero but is not actually zero, with the full value available in tooltipValues.tsxshowcase component demonstrating the new value componentsBreaking 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