Skip to content

[WC-3322]: Fix range-slider decimal places formatting#2239

Open
samuelreichert wants to merge 1 commit into
mainfrom
fix/range-slider-number-format
Open

[WC-3322]: Fix range-slider decimal places formatting#2239
samuelreichert wants to merge 1 commit into
mainfrom
fix/range-slider-number-format

Conversation

@samuelreichert
Copy link
Copy Markdown
Contributor

Pull request type

Bug fix (non-breaking change which fixes an issue)


Description

  • Bring range-slider-web to parity with slider-web's locale-aware number formatting
  • Mark labels and numeric tooltips now use the attribute's NumberFormatter instead of raw .toString(), respecting decimalPlaces, decimal separator, and thousands grouping per session locale
  • Each tooltip handle uses its own formatter (lowerBoundAttribute for index 0, upperBoundAttribute for index 1)

…imal places

Replace raw .toString() / number in mark labels and numeric tooltips with
createValueFormatter — the same pattern used in slider-web. Marks use
lowerBoundAttribute.formatter; each tooltip handle uses its own formatter
(lower for index 0, upper for index 1). The locale decimal separator,
thousands grouping, and decimalPlaces are now all respected.

Add unit tests for createValueFormatter (helpers.spec.ts) and createMarks
(marks.spec.ts) mirroring the slider-web coverage. Update editorPreview
to pass a deterministic preview formatter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@samuelreichert samuelreichert requested a review from a team as a code owner June 1, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant