fix: the balance lists and Home cut amounts to four decimals (closes #757)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run

The balance lists and Home's ETH line rounded with toFixed(4), so 0.99996
ETH read 1.0000 there and 0.9999 on Send. They now cut the stored decimal
string with truncateAmount(), as the history rows do. balanceLine() takes
the stored balance string instead of a parsed number, and escapes the
quantity cell. The screens that state what is authorized keep the floor
of truncateAmountNeverZero().

Model: opus-5-5
This commit is contained in:
sneak committed 2026-11-10 21:54:45 +00:00
1 parent 6d158bf1b1
commit fb7c75101f
12 files changed
+146 -54

No files matched your search

+2 -2
View File
@@ -1191,8 +1191,8 @@ These helpers write one kind of value on every screen that shows it:
Most screens show token and ETH amounts with four decimal places. History rows
cut amounts to four decimals and never round up (`truncateAmount()` in
`src/shared/amountDisplay.js`). The balance lists and Home's ETH balance round
to four places. The screens that state what is being authorized cut as the
`src/shared/amountDisplay.js`). The balance lists and Home's ETH balance cut
them the same way. The screens that state what is being authorized cut as the
history does, and extend an amount below 0.0001 to its first nonzero digit
(`truncateAmountNeverZero()`). So a nonzero amount never reads as zero there.
Those screens are: