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

Digit grouping for large numbers - PowerToys Run's Calculator and Unit Converter plugins #16248

Open
unrealed opened this issue Feb 11, 2022 · 8 comments
Labels
Idea-Enhancement New feature or request on an existing product Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Plugin Things that relate with PowerToys Run's plugin interface

Comments

@unrealed
Copy link

unrealed commented Feb 11, 2022

Description of the new feature / enhancement

Currently, when you use the Calculator or Unit Converter plugins for PowerToys Run, if the result is a large number, it will display all the digits of that number in one string without any spaces.

For example, try typing "2 megatonne in kg" in PowerToys Run and you'll get 2000000000 kg. This is a number that is very annoying to parse for a human since there are no spaces or commas every three digit, like there are when using Window's calculator app.

It would be great if the Calculator/Unit Converter plugins had an option to show results with the digits grouped in groups of 3. Ideally, this option would also let us choose what our separating character is (a space, a comma, or maybe whatever we want).

Another important factor is that some people might want the result displayed with a separator character but want the result added to the clipboard without said character, as some other programs that can use that result might not accept a string with the separator character (for example, Google Sheets sometimes won't accept numbers that are comma-separated)

Scenario when this would be used?

I always use PowerToys Run to make calculations/unit conversions instead of using the calculator as it's just MUCH faster to alt+space and type the equation than going to fetch the calculator app.

But parsing the results when there are lots of digits can waste that productivity improvement and ends up making using the Calculator/Unit Converter plugins a "trap" since the time it took me to count the number of 0s ended up making the use of PowerToys Run not worth it

Supporting information

See how Window's own Calculator app shows results in a much more readable way

@unrealed unrealed added the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label Feb 11, 2022
@unrealed unrealed changed the title Digit grouping for large numbers for PowerToys Run's Calculator plugin Digit grouping for large numbers - PowerToys Run's Calculator and Unit Converter plugins Feb 11, 2022
@franky920920 franky920920 added Idea-Enhancement New feature or request on an existing product Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Plugin Things that relate with PowerToys Run's plugin interface labels Feb 14, 2022
@htcfreek
Copy link
Collaborator

@jaimecbernardo
I tried to implement this yesterday. But it stopped implementation because the official way of setting the parameter in decimal.ToString() will change the decimal digits behavior.

So this has to be discussed.

@jaimecbernardo
Copy link
Collaborator

To what details did you get? I think some code in there ends up trying to use the defined number culture setting, right?

@htcfreek
Copy link
Collaborator

htcfreek commented May 30, 2022

To what details did you get? I think some code in there ends up trying to use the defined number culture setting, right?

There is a second format type modifier that has to be set to "N" (=Number). But that causes results like 5.00 and limits the decimal digit count to 4 (0.1234). I think this changes should be discussed. Maybe we have to write our own solution to add the thousands seperator to the string. (Based on culture settings.)

https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#standard-format-specifiers

I had the code with .ToString() including a setting ready and reverted (removed) it.

@rafaskb
Copy link

rafaskb commented Jul 13, 2023

+1 for this idea, working with large numbers on PowerToys Calculator is really hard and separators on every 3 digits would improve the UX a lot

@Jay-o-Way
Copy link
Collaborator

Jay-o-Way commented Sep 8, 2023

Ideally, this option would also let us choose what our separating character is (a space, a comma, or maybe whatever we want).

...

Note
Numbers consisting of long sequences of digits can be made more readable by separating them into groups, preferably groups of three, separated by a small space. For this reason, ISO 31-0 specifies that such groups of digits should never be separated by a comma or point, as these are reserved for use as the decimal sign.

https://en.wikipedia.org/wiki/ISO_31-0#Numbers or
https://www.bipm.org/en/committees/cg/cgpm/22-2003/resolution-10

@jaimecbernardo @crutkas Maybe we should follow this. Result seems to be the same as what the page @htcfreek linked to, shows: separators (for large numbers) will be a space. Note that, currently, a space is interpreted as an implicit multiplication. I think it's related to ToString(String, IFormatProvider) and NumberFormatInfo.

@Jay-o-Way
Copy link
Collaborator

The thin space is the answer
https://en.m.wikipedia.org/wiki/Thin_space

@NewtonChutney
Copy link

Could this issue be prioritized? Seems like a low hanging improvement?

@Jay-o-Way Jay-o-Way removed the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label Jun 13, 2024
@zsubzwary
Copy link

@crutkas @jaimecbernardo
Can you guys please prioritize this? It’s been 2 and a half years since it’s stuck.

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 Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Plugin Things that relate with PowerToys Run's plugin interface
Projects
None yet
Development

No branches or pull requests

8 participants