1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

9 Commits

Author SHA1 Message Date
Chris Cummer
5e44a01699 Sort exchange rates alphabetically and group same base rates by row color
Before this, exchange rates were read from a map, which meant the
display order was random.

This ensures that the list of exchange rates displays in a consistent
order and visually denotes rates for the same currency.

Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-09-29 10:06:46 -07:00
Chris Cummer
fa5b35b27b WTF-897 Wrap exchange rate error messages for easier viewing
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-07-27 17:22:14 -07:00
Chris Cummer
fd91a48f58 WTF-897 Exchange Rate improvements
Allows the user to set the precision for their exchange rate values.

Config setting:
```
exchangerates:
  precision: 3
```

Default is `7`.

Also aligns converted values along the decimal place for improved
aesthetics.

Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-07-27 17:21:36 -07:00
Chris Cummer
72619a99a4 handle multiple conversions per base currency
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-03-20 19:46:27 -07:00
Indradhanush Gupta
62e3523d29 modules/exchangerate: Display exchange rate for one unit of base currency 2020-03-16 20:23:15 +05:30
Chris Cummer
cde904ff08
Use errcheck to find unhandled errors (#795)
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-17 08:26:16 -08:00
Chris Cummer
3a388fba23
20191215 code improvements (#790)
* Upgrade godo to latest
* Fix a bunch of issues found by
* Running staticcheck on a codebase for the first time is a sobering experience
* go mod tidy
* More static improvements

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-16 20:25:29 -08:00
Toon Schoenmakers
c8a14e7685 Keep an initial order of the currencies so they won't be in a different order after refreshing (#752)
This purely happend due to maps not keeping the order items are in. This way
it at least won't change throughout the runtime of wtfutil. Ideally it would
use and keep the order as specified by the user in the configuration but
right now there is no way to enforce this.
2019-11-16 19:47:52 -08:00
Toon Schoenmakers
244a86cb7e Implemented a module that shows exchange rates from exchangeratesapi.io 2019-11-12 18:06:45 +01:00