microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.68k stars 6.46k forks source link

More BIG and small units for Unit Converter - PowerToys Run #16250

Open unrealed opened 2 years ago

unrealed commented 2 years ago

Description of the new feature / enhancement

It would be really nice to have more units for the Unit Converter plugin of PowerToys Run. There are many in there but some of the more extreme units in terms of scale (like gigatonnes, femtograms, megagram, etc) are not included.

In fact, a megagram, abbreviated Mg, is confused by PowerToys Run with milligrams, abbreviated mg, which is a problem. Case sensitivity should definitely be detected by this plugin.

Scenario when this would be used?

I often make conversions between very extremely large units related to space research and being able to convert solar system-scale or galaxy-scale units to human-scale units is handy to help understand some of the concepts. I don't want to have to go to a website to do those conversions.

Supporting information

No response

MartinSGill commented 2 years ago

Mg, is confused by PowerToys Run with milligrams

This is a more general problem, as the same happens with Mm and mm. I think this might need a more generic SI implementation.

MartinSGill commented 2 years ago

I think I found the issue.

It uses UnitsNet library, which I've used myself and I know does this correctly.

The issue is here: https://github.com/microsoft/PowerToys/blob/28751d2d3689e7a5ac868daf0bbf590188a3e671/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.UnitConverter/UnitHandler.cs#L40

It should do a case-senstive search first and only do a case-insensitive search if that fails (for more "fuzzy" results).