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

Add dots for decimal separator #1937

Merged
merged 6 commits into from
Mar 9, 2024
Merged

Add dots for decimal separator #1937

merged 6 commits into from
Mar 9, 2024

Conversation

bartblaze
Copy link
Contributor

A simple visibility / readability improvement. This is not tested, it should work, but would be great if someone can test!

Example
Will change
image

into:
image

@kevoreilly
Copy link
Owner

Hmm not sure if it's a country-specific thing but in the UK we do no use dots like that. That reads to me as four hundred and thirty nine point three zero four. Here we use commas for that. So the fact that it's not universal means I don't think we should adopt it.

If you are submitting PRs that are not tested, please use the staging branch not master!

@doomedraven
Copy link
Collaborator

it easier to read i agree, in Ukraine we neither use it. but still i do like it :P

@kevoreilly
Copy link
Owner

How about a comma instead of dot? Or maybe a space would be better.

@cccs-kevin
Copy link
Collaborator

How about a comma instead of dot? Or maybe a space would be better.

I like the "space" suggestion. Commas are used in Canada for this sort of thing

@bartblaze
Copy link
Contributor Author

Thanks for the feedback all! 😄 Spaces sound good, but not sure if Django can handle it just like that? Anyone has an idea?

@doomedraven
Copy link
Collaborator

django can do that with custom filter, will add that in near future

@nbargnesi
Copy link
Contributor

Thanks for the feedback all! 😄 Spaces sound good, but not sure if Django can handle it just like that? Anyone has an idea?

Use the l10n support in Django. I think we're at Django 4.2, so should just be a straightforward filter:

{{ report.estimate_day | localize }}

Check out https://docs.djangoproject.com/en/4.2/topics/i18n/formatting/#std-templatefilter-localize.

Though by rough count, I see 157 templates. Localizing just one of them probably isn't ideal.

@bartblaze
Copy link
Contributor Author

Thanks for the feedback all! 😄 Spaces sound good, but not sure if Django can handle it just like that? Anyone has an idea?

Use the l10n support in Django. I think we're at Django 4.2, so should just be a straightforward filter:

{{ report.estimate_day | localize }}

Check out https://docs.djangoproject.com/en/4.2/topics/i18n/formatting/#std-templatefilter-localize.

Though by rough count, I see 157 templates. Localizing just one of them probably isn't ideal.

Probs better to await @doomedraven's implementation / idea, depends on the preference 😄

@r0ny123
Copy link
Contributor

r0ny123 commented Mar 8, 2024

How about a comma instead of dot? Or maybe a space would be better.

I like the "space" suggestion. Commas are used in Canada for this sort of thing

+1 for comma.

@doomedraven
Copy link
Collaborator

done, here is a good explanation how to handle that with coma or make it locale https://stackoverflow.com/questions/1823058/how-to-print-a-number-using-commas-as-thousands-separators/10742904#10742904

@doomedraven
Copy link
Collaborator

image

@doomedraven doomedraven merged commit 4228600 into kevoreilly:master Mar 9, 2024
5 checks passed
@doomedraven
Copy link
Collaborator

so i have put space as is more neutral and easier to read

@bartblaze
Copy link
Contributor Author

Awesome 👍

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

Successfully merging this pull request may close these issues.

6 participants