Skip to content

Support Indonesian number format in transaction amounts - #26

Open
rager306 wants to merge 1 commit into
mainfrom
fix-indonesian-transaction-amounts-12851599774878756901
Open

Support Indonesian number format in transaction amounts#26
rager306 wants to merge 1 commit into
mainfrom
fix-indonesian-transaction-amounts-12851599774878756901

Conversation

@rager306

@rager306 rager306 commented Feb 1, 2026

Copy link
Copy Markdown
Owner

Updated the regex pattern for transaction amounts to correctly identify numbers with comma decimal separators (Indonesian format) while maintaining support for dot decimal separators (US format). Added a new test file to verify transaction extraction for both formats.


PR created automatically by Jules for task 12851599774878756901 started by @rager306

Summary by CodeRabbit

  • New Features

    • Added support for parsing numbers in multiple locale formats, including Indonesian-style formatting with thousands separators and comma as decimal delimiter.
  • Tests

    • Expanded test coverage for transaction extraction to verify handling of multiple number formats.

✏️ Tip: You can customize this high-level summary in your review settings.

Updated `_AMOUNT_PATTERN` in `pdfparser/utils.py` to support both US (dot decimal) and Indonesian (comma decimal) currency formats.
Added regression tests in `tests/test_transaction_extraction.py`.

Co-authored-by: rager306 <248269686+rager306@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Feb 1, 2026

Copy link
Copy Markdown

Walkthrough

Modified the amount pattern regex to support Indonesian number formatting (dots for thousands, comma for decimal) alongside standard decimal notation. Added comprehensive unit tests to validate transaction extraction with both format variants and missing user ID scenarios.

Changes

Cohort / File(s) Summary
Amount Pattern Regex Enhancement
pdfparser/utils.py
Updated _AMOUNT_PATTERN regex to accept both standard decimal notation (e.g., 1,234.56) and Indonesian format (e.g., 1.234.567,89) for flexible number parsing.
Transaction Extraction Test Suite
tests/test_transaction_extraction.py
Added 79 lines of unit tests covering transaction extraction with US and Indonesian number formats, including scenarios with and without user fields. Tests validate date, user, debit, credit, and balance field extraction.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating regex pattern to support Indonesian number format (comma as decimal separator) in transaction amounts.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-indonesian-transaction-amounts-12851599774878756901

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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