Skip to content

feat(Calculator): add thousands separators to display title only#47006

Open
SAY-5 wants to merge 1 commit intomicrosoft:mainfrom
SAY-5:feat/calc-display-separators-v2
Open

feat(Calculator): add thousands separators to display title only#47006
SAY-5 wants to merge 1 commit intomicrosoft:mainfrom
SAY-5:feat/calc-display-separators-v2

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented Apr 14, 2026

Summary of the Pull Request

Rework of #47001, which was correctly closed because it poisoned SaveCommand, CopyTextCommand, and TextToSuggest with formatted values.

This version strictly separates display formatting from data values:

  • Title (display only): gets thousands separators via FormatWithSeparators
  • SaveCommand: keeps the raw result string so saved expressions can be re-parsed
  • CopyTextCommand: keeps the raw decimalResult so pasting into code/spreadsheets works
  • TextToSuggest: keeps the raw decimalResult for query re-submission

This follows the same pattern that PowerToys Run uses, where Title and QueryTextDisplay are separate values.

PR Checklist

Formats the Title with locale-aware thousands separators while
keeping the raw value in SaveCommand, CopyTextCommand, and
TextToSuggest. This prevents the regression where formatted values
like '1,234,567' would poison copy-paste, saved expressions, and
query suggestions.

The separation follows the same pattern PowerToys Run uses with
Title vs QueryTextDisplay.

Fixes microsoft#40203
@crutkas
Copy link
Copy Markdown
Member

crutkas commented Apr 14, 2026

include a pic of before / after

@SAY-5
Copy link
Copy Markdown
Author

SAY-5 commented Apr 14, 2026

Working on getting a Windows build set up for screenshots. In the meantime, the visual change is:

Before: Calculator result for 500000+500000 shows 1000000
After: Shows 1,000,000 (or locale equivalent)

The Title display changes, but copy/paste still gives the raw 1000000 value. Will follow up with actual screenshots once I have a build running.

@crutkas
Copy link
Copy Markdown
Member

crutkas commented Apr 15, 2026

Screenshot please

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.

Large numbers separators in Command palette

2 participants