diff --git a/README.md b/README.md index 3a8fe8a..abf8222 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,16 @@ invisible hit targets, no bare text that happens to have a click handler. If it does something when you click it, it must look like it does something when you click it. +#### Display Consistency + +The same data must be formatted identically everywhere it appears. Token and ETH +amounts are always displayed with exactly 4 decimal places (e.g. "1.0500 ETH", +"17.1900 USDT") — in balance lists, transaction lists, transaction details, send +confirmations, and any other context. Timestamps include both an ISO datetime +and a humanized relative age wherever shown. If a formatting rule applies in one +place, it applies in every place. Users should never see the same value rendered +differently on two screens. + #### Language & Labeling All user-facing text avoids crypto jargon wherever possible: diff --git a/src/popup/views/addressDetail.js b/src/popup/views/addressDetail.js index 592fbea..645c273 100644 --- a/src/popup/views/addressDetail.js +++ b/src/popup/views/addressDetail.js @@ -131,7 +131,8 @@ function showTxDetail(tx) { $("tx-detail-from").textContent = tx.from; $("tx-detail-to").textContent = tx.to; $("tx-detail-value").textContent = tx.value + " " + tx.symbol; - $("tx-detail-time").textContent = isoDate(tx.timestamp); + $("tx-detail-time").textContent = + isoDate(tx.timestamp) + " (" + timeAgo(tx.timestamp) + ")"; $("tx-detail-status").textContent = tx.isError ? "Failed" : "Success"; showView("transaction"); } diff --git a/src/shared/transactions.js b/src/shared/transactions.js index 5af3228..13ab540 100644 --- a/src/shared/transactions.js +++ b/src/shared/transactions.js @@ -7,8 +7,8 @@ const { log } = require("./log"); function formatTxValue(val) { const parts = val.split("."); - if (parts.length === 1) return val; - const dec = parts[1].slice(0, 6).replace(/0+$/, "") || "0"; + if (parts.length === 1) return val + ".0000"; + const dec = (parts[1] + "0000").slice(0, 4); return parts[0] + "." + dec; }