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

PowerLauncher calculator should be customizable #3764

Closed
leduyquang753 opened this issue May 27, 2020 · 8 comments
Closed

PowerLauncher calculator should be customizable #3764

leduyquang753 opened this issue May 27, 2020 · 8 comments
Labels
Area-Localization issues regarding to Localization the application Product-PowerToys Run Improved app launch PT Run (Win+R) Window Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@leduyquang753
Copy link

leduyquang753 commented May 27, 2020

Summary of the new feature/enhancement

Currently the calculator plugin only accepts expressions in the US format. For users using other formats (such as the comma for decimal separation and the dot for multiplication, yes the full stop), the calculator should provide necessary customization options.

Mockup of the feature.

Proposed technical implementation details

  • Customize Mages or use/make a different engine that allows customizations.
  • Add the customizations to the Calculator section of PowerLauncher's settings page.
  • The customizations include: decimal and thousand separators, multiplication sign (for displaying .10^ in the result), angle unit for trigonometric functions,...
  • The separators can be customized by textboxes or more manageable radio buttons/combo boxes.
  • If there is a conflict (for example both the multiplication sign and the decimal separator are the dot), either the settings are automatically fixed or the app simply doesn't let the user set so (by graying out, but less preferred because the user might not be able to swap the signs).
@Jay-o-Way
Copy link
Collaborator

Jay-o-Way commented May 27, 2020

A normal dot (full stop) should not be used in stead of multiplication. In typing the asterisk * is normal and in writing you may use the middle•dot. There is already enough trouble with the locales: Using a comma or full stop as decimal point.

Only valid comment is that the degree sign ° doesn't seem to be supported right now.

@leduyquang753
Copy link
Author

leduyquang753 commented May 27, 2020

A normal dot (full stop) may NEVER be used in stead of multiplication.

The full stop for multiplication is used here in Vietnam, where you can see in all kinds of textbooks for students.

The full stop as multiplication

We shouldn't need to go through the trouble of replacing dots with asterisks when for example, we copy-paste an expression.

In case you missed, here is what I already said in implementation details:

If there is a conflict (for example both the multiplication sign and the decimal separator are the dot), either the settings are automatically fixed or the app simply doesn't let the user set so (by graying out).

ezgif-6-a5ea3cd6ea2b

It's in our own control to not rely on the computer's localization settings and format the numbers according to the app's settings chosen. To prevent inconvenience to the user, we can check for the computer's localization in the first run of the app and initialize the options based on that.

@jyuwono jyuwono added the Product-PowerToys Run Improved app launch PT Run (Win+R) Window label May 27, 2020
@jyuwono jyuwono added this to the v1.0 Release milestone May 27, 2020
@jyuwono jyuwono added the Area-Localization issues regarding to Localization the application label May 27, 2020
@jyuwono
Copy link
Contributor

jyuwono commented May 27, 2020

For the comma as decimal separation, we have another issue tracking it (see #3367)

@crutkas
Copy link
Member

crutkas commented May 27, 2020

I think a good thing we need to do here is come up with a ton of unit tests that handle appropriate regional preferences. Preferred route is adopting the calculator engine which should do this for us for free

@crutkas
Copy link
Member

crutkas commented Jun 5, 2020

@leduyquang753 how does the windows calculator deal with this, does it handle your preferred options by default?

@leduyquang753
Copy link
Author

It currently only handles the decimal separator customization, per Windows' localization settings. I have also opened an issue there to allow different forms of notation as well: microsoft/calculator#1251

@crutkas
Copy link
Member

crutkas commented Jul 31, 2020

@crutkas
Copy link
Member

crutkas commented Sep 8, 2020

Going to track this in #3367

@crutkas crutkas closed this as completed Sep 8, 2020
@crutkas crutkas added the Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. label Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Localization issues regarding to Localization the application Product-PowerToys Run Improved app launch PT Run (Win+R) Window Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

4 participants