You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+59-14Lines changed: 59 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,29 +21,74 @@ move it to the `InstalledPackage` folder located at:
21
21
22
22
## Usage
23
23
24
-
A ```Convert Currency``` item is inserted into the catalog.
24
+
A `Convert Currency` item is inserted into the catalog.
25
25
Select this item to enter conversion mode.
26
26
27
-
Enter the amount to convert, the source currency code and the destination currency code.
28
-
If either the source or destination currency are omitted, the defaults are used.
29
-
If the amount is omitted, the current exchange rate is shown.
27
+
For the most basic usage, simply enter the amount to convert, the source currency and the destination currency, such as `5 USD in EUR`.
28
+
You can perform mathematical operations for the source amount, such as `10*(2+1) usd in EUR`, and you can even perform some math on the resulting amount `5 usd in EUR / 2`.
30
29
31
-
*Currency* allows the source and destination currencies to be separated by any of the following:
32
-
- in
33
-
- to
34
-
- :
30
+
Furthermore, you can add (or subtract) multiple currencies together, such as `5 USD + 2 GBP in EUR`.
31
+
You can also convert into multiple destination currencies, such as `5 USD in EUR, GBP`, and each conversion will be displayed as a separate result.
35
32
36
-
To convert between multiple currencies at the same time, separate each one by a comma.
37
-
This can be done in either the source or destination field, and all combinations will be displayed in the results.
33
+
If you omit the name of a currency, such as in `5 USD` or `5 in USD`, the plugin will use the default currencies specified in the configuration file.
34
+
You can also change what words and symbols are used between multiple destination currencies and between the source and destination.
38
35
39
-
This means that all of the following are allowed:
36
+
### Aliases
40
37
41
-
- 5 usd in inr,JPY
42
-
- EUR to JPY
43
-
- 10 brl,usd:EUR,gbp
38
+
By default, the plugin operates only on [ISO currency codes](https://pt.wikipedia.org/wiki/ISO_4217) (and a few others).
39
+
However, there is support for *aliases*, which are alternative names for currencies.
40
+
In the configuration file, the user can specify as many aliases as they desire for any currency (for instance, `dollar` and `dollars` for USD).
41
+
Aliases, just like regular currency codes, are case-insensitive (i.e. `EuR`, `EUR` and `eur` are all treated the same).
42
+
43
+
44
+
### Math
45
+
46
+
The available mathematical operations are addition (`+`), subtraction (`-`), multiplication (`*`), division (`/`) and exponentiation (`**` or `^`).
47
+
You can also use parentheses and the negative operator (`-(3 + 4) * 4`, for example).
48
+
49
+
### Grammar
50
+
51
+
For those familiar with BNF grammars and regex, below is grammar accepted by the parser (`prog` is the top-level expression):
0 commit comments