Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PTRun][Calc] Add support for different list separators based on locale #36732

Open
PesBandi opened this issue Jan 7, 2025 · 2 comments
Open
Assignees
Labels
Idea-Enhancement New feature or request on an existing product Run-Plugin Things that relate with PowerToys Run's plugin interface Status-In progress This issue or work-item is under development

Comments

@PesBandi
Copy link
Contributor

PesBandi commented Jan 7, 2025

Description of the new feature / enhancement

In cultures where the list separator isn't a comma, the only way to use functions that take multiple arguments is this weird workaround where you surround a comma with spaces (i.e. max(2,7 , 3,5)). I propose replacing the current culture's list separator with the target culture's (en-US) separator, so that you can do max(2,7;3,5).

Scenario when this would be used?

When the current culture uses a different list separator than ,

Supporting information

No response

@PesBandi PesBandi added the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label Jan 7, 2025
@htcfreek htcfreek added Idea-Enhancement New feature or request on an existing product Status-In progress This issue or work-item is under development Run-Plugin Things that relate with PowerToys Run's plugin interface and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Jan 7, 2025
@htcfreek
Copy link
Collaborator

htcfreek commented Jan 7, 2025

@PesBandi
Your contribution is welcome and thank you for your work on this. Feel free to open a PR. If you have any further questions don't worry to ask them.

What's your plan? Setting or simultaneously usage support or general switch of the character?

@PesBandi
Copy link
Contributor Author

PesBandi commented Jan 7, 2025

Hi @htcfreek, I was thinking I'd put it in NumberTranslator, next to where the decimal symbol is replaced.

outputBuilder.Append(
decimal.TryParse(token, NumberStyles.Number, cultureFrom, out number)
? (new string('0', leadingZeroCount) + number.ToString(cultureTo))
: token);

I'm on my way to open the pull request, so maybe check it out there :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Idea-Enhancement New feature or request on an existing product Run-Plugin Things that relate with PowerToys Run's plugin interface Status-In progress This issue or work-item is under development
Projects
None yet
Development

No branches or pull requests

2 participants