DemocracyClub / yournextrepresentative

👥 A website for crowd-sourcing structured election candidate data
https://candidates.democracyclub.org.uk
GNU Affero General Public License v3.0
21 stars 27 forks source link

Number formatting for large numbers #2368

Open edent opened 1 month ago

edent commented 1 month ago

Issue and Steps to Reproduce

On pages like https://candidates.democracyclub.org.uk/leaderboard it is quite hard to parse large numbers.

Screenshots

Screenshot 2024-06-08 at 16-00-05 Top Users

Expected

I'd expect 1234 to be formatted as 1,234

Additional Details

I think this can be fixed. For example:

https://github.com/DemocracyClub/yournextrepresentative/blob/786472ea0b8bc33b0edccfa4e0c03bc599b9716c/ynr/apps/candidates/templates/candidates/leaderboard.html#L29

If I've understood the Django template correctly, can be replaced with:

{% load humanize %}
{{  row.edit_count|intcomma }}

That should probably be used any time there's a number which could be >1,000.