Fix/673 674 decimals and clickable node details - #680
Merged
Conversation
Introduce a locale-aware formatter that caps regular token values at two fraction digits while preserving two significant digits for small non-zero amounts. Apply it to rich-list delegations, staking results, Monero fee and pool values, and the mining calculator; keep USD output in the localized currency formatter with a two-digit maximum. Register focused boundary and locale tests without changing prices, rates, technical metrics, or exact ledger-string displays.
Honor the existing link prop for boolean node-detail statuses and give icon-only anchors the localized row label as their accessible name. Point known Voting states to the validator voting summary, and build supported Send TX destinations from the curated message-type resolver with encoded repeatable query parameters. Keep unknown or unsupported states inert and add a round-trip filter test proving the Send query remains active after parsing.
Capping USD output at two fraction digits made small amounts render as $0.00. The mining calculator shows a pool fee of one to two percent of a daily payout, so any miner earning less than roughly half a dollar a day saw the fee line collapse to zero; the same happened to dust delegations in the validator rich list. Losing the value entirely is worse than the long decimal tail the rounding was meant to remove. formatCurrencyDecimal keeps the two-digit currency format but renders anything below a cent as a bound - <$0.01, or >-$0.01 when negative, since the calculator's net profit goes negative on unprofitable rigs. This mirrors what formatDecimal already does for token amounts: never round a non-zero value down to nothing. The helper caches one Intl.NumberFormat per locale and currency. The rich list builds a formatter per table row, so it was allocating one instance per delegation on every render.
formatXmrReward cut the fractional part with slice(0, 4), so anything below 0.0001 XMR rendered as "0.0000 XMR". A typical Monero transaction fee is around 0.00003 XMR, which meant the fee column on the network transaction list, the fee on a transaction page, and the per-transaction fees inside an expanded block were all showing zero. The cut also truncated rather than rounded, reporting 0.00029 as 0.0002. Reusing formatDecimal fixes both: values at or above 0.01 keep two fraction digits, smaller ones fall back to significant digits, so fees stay readable and block rewards stay short. Block rewards now read 0.61 XMR instead of 0.6086. The average reward card on the blocks page formatted the same quantity with four digits of its own, so it moves to the shared helper too - otherwise the list and the block page disagreed about the same number.
This was referenced Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#673 — new
format-decimal.ts: two decimals at 0.01+, significant digitsbelow, so small amounts don't round to zero. Applied to rich list, both
calculators, Monero tx metrics and pool config. Two extras found while
verifying: USD under a cent now reads
<$0.01instead of$0.00, andformatXmrRewardno longer truncates to four digits — that had turned thewhole fee column on
/networks/monero/txinto0.0000 XMR.#674 —
NodeDetailsItemonly linked its text branch, so status icons wereinert. The icon branch now honors
link(with anaria-label). Voting →validator
voting_summary; Sends TX → account transactions filtered bymessage type, built via
resolveTxMessageTypes. Both gated: no link when thedata isn't there.