Skip to content

[PRAC-260] Format metric trend percentages for clean display - #118

Merged
Kuba0517 merged 1 commit into
mainfrom
feature/PRAC-260-improve-dashboard-cards-values
Feb 9, 2026
Merged

[PRAC-260] Format metric trend percentages for clean display#118
Kuba0517 merged 1 commit into
mainfrom
feature/PRAC-260-improve-dashboard-cards-values

Conversation

@Kuba0517

@Kuba0517 Kuba0517 commented Feb 9, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of edge cases in trend percentage display, ensuring non-finite values are properly formatted as "0%".
  • Refactor

    • Enhanced trend percentage formatting in the dashboard metric cards with consistent localized number formatting and more reliable display logic.

@Kuba0517
Kuba0517 merged commit fff94f0 into main Feb 9, 2026
4 checks passed
@Kuba0517
Kuba0517 deleted the feature/PRAC-260-improve-dashboard-cards-values branch February 9, 2026 19:51
@coderabbitai

coderabbitai Bot commented Feb 9, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

A formatting helper function was added to the metric card component to standardize trend percentage display. The new formatTrendPercentage function handles value formatting with localized decimals and edge-case guards, replacing inline formatting logic in the UI rendering.

Changes

Cohort / File(s) Summary
Trend Percentage Formatting
frontend/src/features/learning/dashboard/metric-card.tsx
Added internal formatTrendPercentage() helper function with absolute value calculation, localized 0–1 decimal formatting, and non-finite value guard. Refactored trend percentage display to use the new helper while preserving sign indicators and color logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A percentage formatter hops into place,
Handling decimals with localized grace,
Non-finite values caught by a guard so true,
The metric card now formats just right, through and through! ✨


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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