Skip to content

fix: rating display - #978

Open
oscarj007 wants to merge 1 commit into
CalloraOrg:mainfrom
oscarj007:task/rating-display
Open

fix: rating display#978
oscarj007 wants to merge 1 commit into
CalloraOrg:mainfrom
oscarj007:task/rating-display

Conversation

@oscarj007

Copy link
Copy Markdown

All requirements have been met:

  1. Implementation: Improved the formatRating function in src/components/StarRating.tsx to use a more robust rounding
    method (Math.round((clamped + 1e-9) * factor) / factor), which ensures consistent half-up rounding and avoids
    common IEEE 754 precision issues (e.g., ensuring 1.005 rounds to 1.01).
  2. Testing: Added a test case expect(formatRating(1.005, 2)).toBe("1.01"); in src/components/StarRating.test.tsx to
    verify the fix. All tests, including existing ones, are passing.
  3. Documentation: Comments in src/components/StarRating.tsx were updated to reflect the rounding logic and precision
    considerations.
  4. Branching & Commit: Created branch task/rating-display and committed the changes with the message fix: rating
    display.

Done.

closes #384

@drips-wave

drips-wave Bot commented Aug 7, 2026

Copy link
Copy Markdown

@oscarj007 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Polish API rating widget

2 participants