Skip to content

Fix/673 674 decimals and clickable node details - #680

Merged
alibabaedge merged 4 commits into
devfrom
fix/673-674-decimals-and-clickable-node-details
Aug 3, 2026
Merged

Fix/673 674 decimals and clickable node details#680
alibabaedge merged 4 commits into
devfrom
fix/673-674-decimals-and-clickable-node-details

Conversation

@m1amgn

@m1amgn m1amgn commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

#673 — new format-decimal.ts: two decimals at 0.01+, significant digits
below, 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.01 instead of $0.00, and
formatXmrReward no longer truncates to four digits — that had turned the
whole fee column on /networks/monero/tx into 0.0000 XMR.

#674NodeDetailsItem only linked its text branch, so status icons were
inert. The icon branch now honors link (with an aria-label). Voting →
validator voting_summary; Sends TX → account transactions filtered by
message type, built via resolveTxMessageTypes. Both gated: no link when the
data isn't there.

m1amgn added 4 commits August 3, 2026 11:10
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.
@alibabaedge
alibabaedge merged commit d8dac16 into dev Aug 3, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants