Advaith3600 / PowerToys-Run-Currency-Converter

PowerToys Run plugin which will convert real and crypto currencies.
141 stars 6 forks source link

Using "in" in query #16

Open vaner-org opened 2 weeks ago

vaner-org commented 2 weeks ago

Hi, just making the suggestion to include "in" like "50 USD in CAD"

I often find myself trying to use it because of Spotlight muscle memory.

Advaith3600 commented 1 week ago

Hi, thanks for the idea, but unfortunately I am traveling and do not have access to a Windows PC for the next couple of weeks. But, if you could modify the code and build it yourself you could get this feature.

You will have to modify the regex from https://github.com/Advaith3600/PowerToys-Run-Currency-Converter/blob/314a300540ef2fad155ce1581bdecd7d36b76033/Community.PowerToys.Run.Plugin.CurrencyConverter/Main.cs#L363

to something like

@"^\s*(?:(?:(?<amount>[0-9.,+\-*/ \(\)]+)\s*(?<from>\w*))|(?:(?<from>[a-zA-Z]*)\s*(?<amount>[0-9.,+\-*/ \(\)]+)))\s*(?:to|in)?\s*(?<to>\w*)\s*$"
vaner-org commented 1 week ago

Thank you! I'll try this out.