Skip to content

fix: format size to close percentage with fixed 2 decimal places (Fixes #11)#239

Open
zeroknowledge0x wants to merge 1 commit into
capofficial:mainfrom
zeroknowledge0x:fix/size-to-close-formatting
Open

fix: format size to close percentage with fixed 2 decimal places (Fixes #11)#239
zeroknowledge0x wants to merge 1 commit into
capofficial:mainfrom
zeroknowledge0x:fix/size-to-close-formatting

Conversation

@zeroknowledge0x
Copy link
Copy Markdown

Summary

Fixes the size to close percentage formatting issue (#11) where the percentage could display with too many decimal places.

Changes

  • Changed from to
  • Uses fixed 2 decimal places for consistent percentage display
  • Ensures the percentage always shows like instead of or

Cause and Fix

Cause: The function uses dynamic decimal places based on the number magnitude. For percentages, this could result in inconsistent formatting (e.g., vs ).

Fix: Use directly on the percentage value for consistent 2 decimal place formatting.

Acceptance Criteria

  • Percentage displays with consistent 2 decimal places
  • Works correctly for all percentage values (0-100%)
  • No console errors

Closes #11

- Use toFixed(2) instead of formatForDisplay for percentage display
- Ensures consistent formatting regardless of percentage value
- Fixes issue where percentage could show too many decimal places

Fixes capofficial#11
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.

Size to close is not well formatted, sometimes

1 participant