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

[PT Run] Calculator interprets comma used as number separator as decimal separator #17300

Closed
1 task
htcfreek opened this issue Mar 27, 2022 · 16 comments
Closed
1 task
Assignees
Labels
Issue-Bug Something isn't working Product-PowerToys Run Improved app launch PT Run (Win+R) Window Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. Run-Plugin Things that relate with PowerToys Run's plugin interface

Comments

@htcfreek
Copy link
Collaborator

htcfreek commented Mar 27, 2022

Microsoft PowerToys version

0.56.2

Running as admin

  • Yes

Area(s) with issue?

PowerToys Run

Steps to reproduce

Typing max(1,2).

✔️ Expected Behavior

Expected result: 2 as this is the highest number.

❌ Actual Behavior

Actual result: 1.2 (1,2) because in Germany we use , as decimal separator.

For example pow work only if I have at least three numbers like pow(3,3,3).

Other Software

No response

@htcfreek htcfreek added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Mar 27, 2022
@htcfreek htcfreek changed the title [PT Run] Calculator max not working as expected [PT Run] Calculator interprets comma used as number separator as decimal separator Mar 27, 2022
@htcfreek htcfreek added Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Plugin Things that relate with PowerToys Run's plugin interface labels Mar 27, 2022
@jaimecbernardo
Copy link
Collaborator

Unfortunately, something that can be done so that the number isn't interpreted together is separating the commas from function calling by spaces, like max(1 , 2). Unfortunately, doing number translation between cultures is tricky. Perhaps what we can do here is add an option so that we don't try to accept culture translated numbers?

@htcfreek
Copy link
Collaborator Author

what about using ; instead of , to separate numbers?

@jaimecbernardo
Copy link
Collaborator

Perhaps doing a pass where we'd convert ; to, before sending it to mages? After we do the translation? I don't know if there are cultures where ; may be used as a decimal or thousands separator, though.

@htcfreek
Copy link
Collaborator Author

Perhaps doing a pass where we'd convert ; to, before sending it to mages? After we do the translation?

That's my idea.

I don't know if there are cultures where ; may be used as a decimal or thousands separator, though.

Don't think so. Let's ask google. 😂

@htcfreek
Copy link
Collaborator Author

https://en.m.wikipedia.org/wiki/Decimal_separator says only comma or dot is used per standard

@htcfreek
Copy link
Collaborator Author

do you think this should be a setting?

@jaimecbernardo
Copy link
Collaborator

It could be a setting, turned off by default.

@jaimecbernardo jaimecbernardo added this to the Post stabilization milestone Mar 29, 2022
@jaimecbernardo jaimecbernardo removed the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label Mar 29, 2022
@Jay-o-Way
Copy link
Collaborator

do you think this should be a setting?

I don't.

@jaimecbernardo
Copy link
Collaborator

The settings would be about converting intput from culture and then another one to convert output to culture, as discussed here: #17381

@htcfreek htcfreek self-assigned this Apr 30, 2022
@htcfreek
Copy link
Collaborator Author

htcfreek commented May 2, 2022

@jaimecbernardo
Should I reverting #16980 when I implement the two new settings?

@jaimecbernardo
Copy link
Collaborator

@jaimecbernardo Should I reverting #16980 when I implement the two new settings?

I wonder. I think people will still expect the calculator to take "." 🤷
Setting for "always interpret "." as a decimal point"? 😅

This sounds like so many settings though.

@htcfreek
Copy link
Collaborator Author

htcfreek commented May 3, 2022

@jaimecbernardo Should I reverting #16980 when I implement the two new settings?

I wonder. I think people will still expect the calculator to take "." 🤷
Setting for "always interpret "." as a decimal point"? 😅

This sounds like so many settings though.

I thought on two settings without some combinations of dot and comma:

  • "Use english format for input instead of your local one."
  • "Use english format for output instead of your local one."

We can add an example input and output to the description of the settings.

I am from Germany and wonder how the input with local format has to be. 😅

@jaimecbernardo
Copy link
Collaborator

Sounds good. I think we won't even need to run "translation" functions in that case, since Mages already works with the English format. (Wonder if english-US should be specified)

@htcfreek htcfreek added the Status-In progress This issue or work-item is under development label May 8, 2022
@htcfreek
Copy link
Collaborator Author

htcfreek commented May 8, 2022

@Jay-o-Way
If you react with a thumbs down emoji please explain what you don't like.

@Jay-o-Way
Copy link
Collaborator

I'm not a fan of so many settings. But that's personal.

@jaimecbernardo jaimecbernardo added the Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. label Jun 2, 2022
@htcfreek
Copy link
Collaborator Author

Released with 0.59.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Product-PowerToys Run Improved app launch PT Run (Win+R) Window Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. Run-Plugin Things that relate with PowerToys Run's plugin interface
Projects
None yet
Development

No branches or pull requests

3 participants