Skip to content
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

Thousands separator in badge image #559

Open
sfan5 opened this issue Aug 16, 2024 · 4 comments
Open

Thousands separator in badge image #559

sfan5 opened this issue Aug 16, 2024 · 4 comments

Comments

@sfan5
Copy link
Member

sfan5 commented Aug 16, 2024

Problem

Badge image shows 1234546 downloads

Solutions

Badge image should show 1,234,546 downloads because that's easier to read

Additional context

https://stackoverflow.com/questions/1823058/how-to-print-a-number-using-commas-as-thousands-separators

@rubenwardy
Copy link
Member

The badges are currently generated by shields.io by making a request to a JSON API, there doesn't appear to be an option to change the formatting:

https://img.shields.io/badge/dynamic/json?color=%23375a7f&label=ContentDB&query=downloads&suffix=+downloads&url=https%3A//content.minetest.net/api/packages/Wuzzy/glitch/

So it's likely the code will need to switch to using a static shields.io badge with the information added by the ContentDB redirect: https://github.com/minetest/contentdb/blob/master/app/blueprints/packages/packages.py#L195-L198

@Zughy
Copy link
Member

Zughy commented Sep 18, 2024

Fun fact: in Italian, we use commas as floating points and dots as thousands. So if I see a number like 2,305, I read it as 2 (int) and 305 (decimals). Probably Italian is not the only one, so I'd say that the translator should be able to edit the format as well

@sfan5
Copy link
Member Author

sfan5 commented Sep 18, 2024

German does this too.
If we don't want to mess with i18n I think a safe compromise is 1 234 546 downloads

@Zughy
Copy link
Member

Zughy commented Sep 18, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants