Skip to content

Percentage buttons (conversion / cashout '100%') round the raw balance up to an unsendable amount #696

Closed

Description

@islandbitcoin

Found during the #695 review. The percentage quick-buttons Math.round the raw fractional-cent balance (conversion-details-screen.tsx:~110, CashoutDetails.tsx:~209), so on a wallet holding 109.9346 cents, tapping 100% sets 110¢ — more than is spendable. In cashout this drives the user straight into the max-amount error (now floored by #695, so at least the error is honest); in conversion it sets an amount the swap can't fill.

Fix mirrors #689/#695's rule: for the 100% case, floor to whole spendable minor units (toSpendableBalance from #695); for partial percentages, Math.floor instead of Math.round keeps every quick-set amount ≤ spendable.

Related: #689 (send-flow MAX — does NOT cover these buttons), #690/#695 (display floor), flash#480 (fractional balances).

🤖 Generated with Claude Code

https://claude.ai/code/session_015fAxSGEsL2LsMx1uCjAzHH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions