Skip to content

fix: sort transaction history by numeric amount, not formatted text#6

Open
theyavuzarslan wants to merge 1 commit into
circlefin:masterfrom
theyavuzarslan:fix/numeric-amount-sort
Open

fix: sort transaction history by numeric amount, not formatted text#6
theyavuzarslan wants to merge 1 commit into
circlefin:masterfrom
theyavuzarslan:fix/numeric-amount-sort

Conversation

@theyavuzarslan

@theyavuzarslan theyavuzarslan commented Jul 6, 2026

Copy link
Copy Markdown

The Amount column in the transaction history sorts on amount_formatted, which is a text column (the init migration defines amount numeric(78, 0) and amount_formatted text). Supabase orders it lexicographically, so "100" sorts before "20", which sorts before "3". Any mix of amounts with different digit counts comes back in the wrong order.

The fix changes SortColumn from "amount_formatted" to "amount" and updates the SortableHeader column prop in TransactionHistory.tsx. The numeric amount column already exists, so there is no migration. amount_formatted is still what gets displayed. Both tokens in this app use 8 decimals, so ordering by raw units gives the same order as the displayed values.

The Amount column sorted on amount_formatted, a text column, so rows
ordered lexicographically ('100' < '20' < '3'). Sort on the numeric
amount column instead and keep amount_formatted for display only.
The amount column already exists in the schema; no migration needed.
@theyavuzarslan
theyavuzarslan force-pushed the fix/numeric-amount-sort branch from e1a7668 to 91611ff Compare July 13, 2026 14:32
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.

1 participant