New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
currency: add thousands separator, dynamic precision, and optional HTTPS for Fixer #1988
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is a bit confusing at first, so it needs at least a few comments to make it easier for future reader to understand what is going on.
Furthermore, our commit convention is to use this format:
plugin-name: reason
Not [Plugin Name] reason
.
Merging #1989 should fix the spurious CI failures. Keep an eye on this build—if it passes, feel free to squash/rebase away. |
d59d59e is pretty ridiculous. What in the world is Fixer doing with HTTPS that it costs too much to provide for all users?! |
Exirel mentioned the possibility that an API key could contain invalid characters, theoretically, and I figured it was worthwhile to add in a step to make that value safe for URLs as long as I was touching this plugin's code again.
Kind of annoying to get things like "1e06 XLM" in the output when we've been so careful to make sure the converted value won't be printed as engineering notation. This is a simple fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's hope this doesn't brake break too often...
Brake? Even if that's a typo, I don't see what would break. |
The Fixer API, or any other currency API. It feels like it's going downhill like the weather APIs. 😞 |
Ah, Fixer is just getting the sh*t monetized out of it. There are several other Fixer-compatible sites out there; the two we merged a few days ago are just a random selection. Still thinking about that true "custom" option, to provide one last-ditch escape hatch for 7.1.x clients with a free-entry URL config value. |
Description
The current code only adds more precision when converting bitcoin. Other crypto currencies are also valued such that they return very small numbers.
This change finds the required amount of digits to display at least 2 non-zero decimals.
It also adds thousands separators to the reply.
Checklist
make qa
(runsmake quality
andmake test
)One issue was reported by make qa, but in help.py (ambiguous variable name l)