alexanderepstein / Bash-Snippets

A collection of small bash scripts for heavy terminal users
MIT License
9.64k stars 842 forks source link

Add support for currencies hard-pegged to other currencies #194

Closed michalfabik closed 5 years ago

michalfabik commented 5 years ago

Signed-off-by: Michal Fabik michal.fabik@gmail.com

Add support for currencies hard-pegged to other currencies:

I was missing the possibility convert the Bosnian mark. It usually isn't listed in exchange rate lists because it's pegged to the euro at a fixed rate. I added a function with hardcoded rates of several pegged currencies (this should be fine since the rates hardly ever change) and reworked the convertCurrency function so it checks whether any of the currencies on the input is a pegged one and if yes, it calculates its exchange rate based on the exchange rate of the base currency retrieved through the API and the hardcoded rate of the pegged currency.
I added a few more currencies, mainly for testing.

Pull Request Checklist:


stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

alexanderepstein commented 5 years ago

Thanks for the contribution 🎊