feat: standardize currency display across platform#447
Merged
codeZe-us merged 1 commit intoApr 26, 2026
Merged
Conversation
- Add global formatCurrency utility in src/utils/formatters.ts - Implement secure kobo-to-NGN conversion using Intl.NumberFormat - Update 6 components to use centralized currency formatting - Add comprehensive unit tests for formatter utility - Ensure consistent currency display across finance, payroll, and invoices Files changed: - src/utils/formatters.ts (new) - src/utils/formatters.test.ts (new) - src/app/(dashboard)/invoices/[id]/page.tsx - src/app/(dashboard)/invoices/page.tsx - src/app/(dashboard)/payroll/components/PayoutHistory.tsx - src/components/features/finance/NairaTransactionHistory.tsx - src/components/features/invoices/InvoiceSummary.tsx - src/components/features/invoices/InvoiceDetailsSection.tsx
|
@abbakargarba is attempting to deploy a commit to the vestroll's projects Team on Vercel. A member of the Team first needs to authorize it. |
codeZe-us
approved these changes
Apr 26, 2026
Contributor
codeZe-us
left a comment
There was a problem hiding this comment.
@abbakargarba Good work
Author
thank you boss |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #436
Title
feat: implement global currency formatting utility for standardized monetary display
Overview
This PR introduces a global currency formatting utility to standardize how money is displayed across the platform, securely converting backend bigint kobo values into displayable currency values.
It centralizes formatting logic, improves consistency across dashboards and financial views, and supports localized formatting using
Intl.NumberFormat.🚀 Implementation Approach
Key Changes
Global
formatCurrencyUtilityCreated:
Features:
Uses
Intl.NumberFormatfor localized formattingConverts kobo → NGN by dividing by
100Supports multiple currencies:
Example output:
Graceful Value Handling
Safely handles:
nullundefinedIncludes fallback behavior to prevent UI failures.
Updated Components
Integrated the formatter across 6 component files:
Finance
NairaTransactionHistory.tsxPayroll
PayoutHistory.tsxInvoices
invoices/page.tsxinvoices/[id]/page.tsxInvoiceSummary.tsxInvoiceDetailsSection.tsx🧪 Testing
Added:
Includes unit coverage for:
🔧 Technical Details
Backend Integration
Safely converts:
Localization
Uses:
with proper locale-aware formatting.
Type Safety
Error Handling
Consistency
All monetary displays now use a single formatting standard.
📁 Files Changed
New Files
src/utils/formatters.tssrc/utils/formatters.test.tsUpdated Files
src/app/(dashboard)/invoices/[id]/page.tsxsrc/app/(dashboard)/invoices/page.tsxsrc/app/(dashboard)/payroll/components/PayoutHistory.tsxsrc/components/features/finance/NairaTransactionHistory.tsxsrc/components/features/invoices/InvoiceSummary.tsxsrc/components/features/invoices/InvoiceDetailsSection.tsx✅ What Done Looks Like
Intl.NumberFormat📋 Testing Results
📈 Impact
None — fully backward compatible.
🌿 Branch
Source:
feature/Fix-and-Standardize-Currency-DisplayTarget:
dev✅ Checklist