Skip to content

Commit

Permalink
Version 1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Advaith3600 committed May 17, 2024
1 parent eaca7bc commit 1726d8c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<UseWindowsForms>true</UseWindowsForms>
<RootNamespace>Community.PowerToys.Run.Plugin.CurrencyConverter</RootNamespace>
<AssemblyName>Community.PowerToys.Run.Plugin.CurrencyConverter</AssemblyName>
<Version>1.1.2</Version>
<Version>1.1.3</Version>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<Platforms>AnyCPU;x64;ARM64</Platforms>
Expand Down
11 changes: 3 additions & 8 deletions Community.PowerToys.Run.Plugin.CurrencyConverter/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private double GetConversionRate(string fromCurrency, string toCurrency)
IcoPath = IconPath,
Action = e =>
{
Clipboard.SetText(rawConvertedAmount.ToString());
Clipboard.SetText(toFormatted);
return true;
}
};
Expand Down Expand Up @@ -257,20 +257,15 @@ public double Evaluate(string expression)
while (i < expression.Length && ((expression[i] >= '0' && expression[i] <= '9') || expression[i] == '.'))
sbuf.Append(expression[i++]);
values.Push(double.Parse(sbuf.ToString()));
if (i < expression.Length && expression[i] == ')')
{
while (ops.Count > 0 && ops.Peek() != '(')
values.Push(ApplyOp(ops.Pop(), values.Pop(), values.Pop()));
ops.Pop();
}
i--;
}

else if (expression[i] == '(')
ops.Push(expression[i]);

else if (expression[i] == ')')
{
while (ops.Peek() != '(')
while (ops.Count > 0 && ops.Peek() != '(')
values.Push(ApplyOp(ops.Pop(), values.Pop(), values.Pop()));
ops.Pop();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"ActionKeyword": "$$",
"Name": "Currency Converter",
"Author": "advaith3600",
"Version": "1.1.2",
"Version": "1.1.3",
"Language": "csharp",
"Website": "https://github.com/advaith3600/PowerToys-Run-Currency-Converter",
"ExecuteFileName": "Community.PowerToys.Run.Plugin.CurrencyConverter.dll",
Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,31 @@ $$ 1 btc to usd

### Quick Conversions

You can quickly convert from your local currency to a global currency by just typing the number. This list will also include all the extra currencies that you have configured in the settings panel.
You can swiftly convert from your local currency to another currency simply by typing the number. The settings allow you to change both the local and all other currencies.

```
$$ 102.2
```

![Screenshot](screenshots/screenshot4.png)

### Output formatting
### Output formatting and precision

The plugin supports two modes of output
The plugin supports two modes of output:

1. Short Text: The output will contain the to currency only
2. Full Text: The output will contain the from currency and the to currency
Short Text: The output will only contain the target currency.
Full Text: The output will contain both the source and target currencies.

You can adjust the precision value in the settings. This will determine the number of decimal points to be displayed. The plugin outputs values using dynamic precision. This means that if a value is less than 0, the number of non-zero decimals displayed will be exactly as specified in the settings.

![Screenshot](screenshots/screenshot5.png)

### Mathematical Calculations

You can input mathematical expressions, and the plugin will evaluate them using the BODMAS rule. The permitted operations are `+` (addition), `-` (subtraction), `*` (multiplication), and `/` (division). The use of brackets is also supported.

![Screenshot](screenshots/screenshot6.png)

## Installation

1. Download the latest release of the Currency Converter from the [releases page](https://github.com/advaith3600/powertoys-run-currency-converter/releases).
Expand Down
Binary file modified screenshots/screenshot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/screenshot6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1726d8c

Please sign in to comment.