Skip to content

Display currency symbol in column header, do not put currency symbols in amounts, support non-USD YNAB plans#24

Merged
wesm merged 2 commits intomainfrom
more-amount-formatting
Oct 31, 2025
Merged

Display currency symbol in column header, do not put currency symbols in amounts, support non-USD YNAB plans#24
wesm merged 2 commits intomainfrom
more-amount-formatting

Conversation

@wesm
Copy link
Owner

@wesm wesm commented Oct 30, 2025

This also adjusts some column display widths for better (subjective) readability (eventually these can be made configurable via config.yaml).

image

wesm and others added 2 commits October 30, 2025 18:21
Reduces visual noise by showing currency once in header instead of every cell.

Changes:
1. Added get_currency_symbol() to FinanceBackend base class (defaults to "$")
2. YNAB backend fetches currency from budget.currency_format.currency_symbol
3. Monarch/Amazon/Demo backends use default "$"
4. AppController._get_column_config() adds currency_symbol to config dict
5. Formatters extract currency from column_config (DRY, no threading through calls)
6. format_amount() now returns "-1,234.56" instead of "-$1,234.56"
7. Column headers updated to "Total ($)" and "Amount ($)"
8. Created expected_amount() test helper in conftest.py for DRY test assertions
9. Updated all formatter tests to expect new format

Implementation:
- Currency flows: Backend → column_config → formatters (simple, no refactoring)
- YNAB supports €/£/other currencies from API
- Monarch defaults to $ (no currency API found)

All 895 tests pass, all style checks pass.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@wesm
Copy link
Owner Author

wesm commented Oct 30, 2025

I created a Euro YNAB plan just to make sure it works:

image

@wesm wesm merged commit 98cba2f into main Oct 31, 2025
6 checks passed
@wesm wesm deleted the more-amount-formatting branch October 31, 2025 04:54
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