Skip to content

fix: restore maximumFractionDigits: 0 on sparkline data label formatter#2657

Closed
2u841r wants to merge 2 commits intonpmx-dev:mainfrom
2u841r:fix/sparkline-decimal-label
Closed

fix: restore maximumFractionDigits: 0 on sparkline data label formatter#2657
2u841r wants to merge 2 commits intonpmx-dev:mainfrom
2u841r:fix/sparkline-decimal-label

Conversation

@2u841r
Copy link
Copy Markdown

@2u841r 2u841r commented Apr 29, 2026

🔗 Linked issue

Closes #2656

🧭 Context

PR #2556 added Math.ceil in applyDataCorrection to fix decimal numbers in the weekly downloads label, but also removed maximumFractionDigits: 0 from the formatter in WeeklyDownloadStats.vue — which was actually the effective guard.

VueUiSparkline does its own internal interpolation and passes float values directly to dataLabel.formatter, bypassing applyDataCorrection entirely. Without maximumFractionDigits: 0, those floats render as 1,195,399.72 instead of 1,195,400.

📚 Description

Restore maximumFractionDigits: 0 on the useNumberFormatter call used for the sparkline data label. One-line change.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Apr 29, 2026 4:13pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Apr 29, 2026 4:13pm
npmx-lunaria Ignored Ignored Apr 29, 2026 4:13pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 24911595-7a50-4798-97a4-8ff249d812df

📥 Commits

Reviewing files that changed from the base of the PR and between 5eab00c and b00cdb1.

📒 Files selected for processing (1)
  • app/components/Package/WeeklyDownloadStats.vue

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Updated numeric label formatting in the weekly download statistics chart to display whole numbers without decimal places.

Walkthrough

Restores the maximumFractionDigits: 0 constraint to the number formatter in the weekly downloads chart component, preventing decimal digits from appearing in data labels caused by VueUiSparkline's internal float interpolation.

Changes

Cohort / File(s) Summary
Weekly Download Stats Formatter
app/components/Package/WeeklyDownloadStats.vue
Restores maximumFractionDigits: 0 parameter to useNumberFormatter() to ensure data labels display integers only, resolving decimal digit display issue caused by component's internal interpolation.

Possibly related PRs

Suggested reviewers

  • graphieros
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: restoring maximumFractionDigits: 0 on the sparkline data label formatter, which directly matches the code modification.
Description check ✅ Passed The description provides relevant context about the bug, explains the root cause, and documents the decision to implement Option A, all directly related to the changeset.
Linked Issues check ✅ Passed The pull request fully implements the coding requirement from issue #2656 by restoring maximumFractionDigits: 0 in the formatter, which addresses the root cause of decimal digits appearing in weekly downloads labels.
Out of Scope Changes check ✅ Passed The change is a single-line modification directly addressing the linked issue, with no out-of-scope or unrelated changes introduced.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

@github-actions
Copy link
Copy Markdown

Hello! Thank you for opening your first PR to npmx, @2u841r! 🚀

Here’s what will happen next:

  1. Our GitHub bots will run to check your changes.
    If they spot any issues you will see some error messages on this PR.
    Don’t hesitate to ask any questions if you’re not sure what these mean!

  2. In a few minutes, you’ll be able to see a preview of your changes on Vercel

  3. One or more of our maintainers will take a look and may ask you to make changes.
    We try to be responsive, but don’t worry if this takes a few days.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@2u841r
Copy link
Copy Markdown
Author

2u841r commented Apr 29, 2026

Closing -- this reverts a deliberate decision from the maintainer in #2556. The fix is already in main via #2519 and #2550, pending next release.

@2u841r 2u841r closed this Apr 29, 2026
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.

bug: weekly downloads label shows decimal digits

1 participant