Bug: MAX button formats value with commas — HTML number input can't parse #90
Labels
No labels
agent:implement
agent:ready
backend
bug
cannot-reproduce
confirmed
desktop
docs
documentation
duplicate
enhancement
feature
frontend
good first issue
help wanted
high-risk
in-review
invalid
mobile
needs-triage
P0-critical
P1-high
P2-medium
P3-low
qa
QA
question
ready
report
responsive
security
security-escalate
smart-contract
solana
tablet
test-pass
ux
wallet-issue
wallet:keplr
wallet:metamask
wallet:station
wallet:walletconnect
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-bridge-monorepo#90
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
clicking MAX on the amount field sets the value to '1,000,000.00' (with commas). HTML input type=number can't parse comma-formatted values, so the field displays 0.0 and the transfer form sends the wrong amount.
console warning:
The specified value "1,000,000.00" cannot be parsed, or is out of range.
seen on LocalTerra->Solana Localnet with 1M TKNA balance. MAX should set the raw numeric value without locale formatting (e.g. 1000000.00 not 1,000,000.00).
commit
74b5f3e, laptop Vite workflow.mentioned in commit
86bef9f613Fix pushed
Cause:
handleMaxusedformatAmount(), which callstoLocaleString('en-US', …)and adds thousands separators.<input type="number">rejects strings like1,000,000.00, so the field fell back to empty / wrong values.Change: Added
formatAmountForNumberInput()(same rounding rules,useGrouping: false) and use it inTransferFormwhen setting the amount from MAX.Commit:
86bef9fonfeat/solana-integration.@Brouie could you review when you have a chance?
partial fix -- MAX no longer inserts commas (LUNC fills as 500000.00). but tokens with 18 decimals (TKNA) still crash on MAX because the scaled amount becomes 5e+23 scientific notation, hitting the same BigInt crash as #95. #90 comma fix is verified, the remaining crash is tracked in #95.