Skip to content

Conversation

@gurnoorpannu
Copy link
Contributor

@gurnoorpannu gurnoorpannu commented Jan 30, 2026

Fixes - MIFOSAC-639

  • Added proper currency formatting to all monetary values in the Loan Account Summary screen using the existing CurrencyFormatter utility.
  • All loan amounts now display with correct currency code, commas, and decimal precision (e.g., ₹ 10,000.00, $ 3,250.50) instead of raw numbers.
  • Updated Info cards, Loan overview, and Summary table so every financial field is formatted consistently.

Before:-
image
image

After:-

image image

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the static analysis check ./gradlew check or ci-prepush.sh to make sure you didn't break anything

  • If you have multiple commits please combine them into one commit by squashing them.

Summary by CodeRabbit

  • New Features
    • Loan account summary amounts now display with proper currency formatting throughout the screen and summary table.
    • Formatting respects the loan's currency code and decimal precision, improving readability for totals, principal, interest, fees, penalties, and outstanding balances.

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

Added currency-aware display formatting to LoanAccountSummaryScreen by integrating CurrencyFormatter and propagating currencyCode and decimalPlaces into LoanSummaryDataTable; monetary fields and table columns now use formatted output instead of raw toString() values.

Changes

Cohort / File(s) Summary
Loan account summary UI
feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/loanAccountSummary/LoanAccountSummaryScreen.kt
Imported CurrencyFormatter; added formatCurrency(amount) in LoanAccountSummaryContent; replaced direct toString() uses for totals and info cards with formatCurrency(...); passed currencyCode and decimalPlaces into LoanSummaryDataTable.
Loan summary table signature & formatting
feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/loanAccountSummary/LoanAccountSummaryScreen.kt
Updated LoanSummaryDataTable signature to accept currencyCode: String? and decimalPlaces: Int?; added formatAmount(amount) helper and replaced numeric toString() uses for table columns with formatAmount(...).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • revanthkumarJ
  • therajanmaurya

Poem

🐰 I hopped through code in a twirl and a cheer,
I taught the numbers to wear their gear,
Coins now sparkle, decimals in place,
Every amount shows its currency face,
Hooray—pretty numbers, tidy and clear! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(loan): add currency formatting to loan account summary' directly and accurately summarizes the main change: adding currency formatting to the loan account summary screen.

✏️ 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

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@feature/loan/src/commonMain/kotlin/com/mifos/feature/loan/loanAccountSummary/LoanAccountSummaryScreen.kt`:
- Around line 291-295: The code currently hard-codes maximumFractionDigits = 2
in CurrencyFormatter calls; update both occurrences in formatCurrency and
formatAmount to use the currency precision from loanWithAssociations.currency
(e.g., use currency?.decimalPlaces or currency.decimalPlaces ?: 0 to match
project null-safety conventions) so the CurrencyFormatter.format(...) passes the
currency-specific decimalPlaces instead of 2.

@biplab1
Copy link
Contributor

biplab1 commented Jan 30, 2026

@coderabbitai Improve the PR title based on: github.com/openMF/mobile-wallet/wiki/Commit-style-guide. Give us just the title.

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🌐 Web query:

github.com/openMF/mobile-wallet/wiki/Commit-style-guide

💡 Result:

The openMF/mobile-wallet wiki “Commit style guide” specifies this commit message format:

  • Format: <type>(<scope>): <subject> (where <scope> is optional) [1]
  • Scope guidance: use a brief, recognizable scope if the change targets one/two packages (examples given: content-docs, theme-classic, core) [1]
  • Allowed types: [1]
    • feat: new API/behavior for end user
    • fix: bug fix for end user
    • docs: change to website/Markdown docs
    • refactor: production code change with no behavior difference
    • test: test-only changes
    • chore: maintenance tasks (deps, releases, etc.)
    • misc: other non-production-code changes not covered by test/chore (e.g., GitHub Actions workflow updates)
  • Notes on PR titles: PRs are squash-merged; the commit to the dev branch uses the PR title, so branch commits don’t need perfect semantic naming; maintainers can help align PR titles and labels [1]
  • Example: feat(core): allow overriding of gradle config (subject should be present tense, lower case) [1]

Source: [1]


@biplab1:

feat(loan): add currency formatting to loan account summary

@biplab1
Copy link
Contributor

biplab1 commented Jan 30, 2026

@gurnoorpannu Could you please update the PR title to this: feat(loan): add currency formatting to loan account summary?

@gurnoorpannu gurnoorpannu changed the title Fixes MIFOSAC: Added Currency symbols/labels on Loan Account Summary … feat(loan): add currency formatting to loan account summary Jan 30, 2026
@gurnoorpannu
Copy link
Contributor Author

@coderabbitai Improve the PR title based on: github.com/openMF/mobile-wallet/wiki/Commit-style-guide. Give us just the title.

sure

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

Tip

For best results, initiate chat on the files or code changes.

@gurnoorpannu: Thank you for confirming! Once you update the PR title, it will align perfectly with the commit style guide. 🎯

Copy link
Collaborator

@itsPronay itsPronay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, can get merged

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.

4 participants