-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Fixed #35095 Updated Swiss (German) number formatting to match common IT practices. #19396
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
base: main
Are you sure you want to change the base?
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.
Thank you @AhmedNassar7
I have minor comments 👍
DECIMAL_SEPARATOR = "," | ||
THOUSAND_SEPARATOR = "\xa0" # non-breaking space | ||
DECIMAL_SEPARATOR = "." | ||
THOUSAND_SEPARATOR = "'" # single quote |
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.
I don't think we have agreement to update the THOUSAND_SEPARATOR
Also reading the linked wikepedia docs, it says (translated):
Neither dot nor comma are used as thousand separators. If a protected space is not set as a thousand separator, the (even) apostrophe (') is used.
Meaning the space is used (I'd assume more commonly), with the apostrophe being the exception
The Swiss number formatting traditionally varies depending on context. For example, | ||
monetary values might use a dot as decimal separator (Fr. 23.50), while | ||
measurements might use a comma (22,5 m). Django's localization system cannot | ||
handle such context-specific formats automatically. | ||
|
||
The locale format provided by Django follows common IT practices in Switzerland, | ||
using a dot as the decimal separator and a single quote as the thousand | ||
separator, matching the behavior of major operating systems and applications | ||
in the region. | ||
|
||
For Swiss government publication guidelines and additional context, see: | ||
- https://www.bk.admin.ch/bk/de/home/dokumentation/sprachen/hilfsmittel-textredaktion/schreibweisungen.html | ||
- https://de.wikipedia.org/wiki/Dezimaltrennzeichen#Schweiz |
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 Swiss number formatting traditionally varies depending on context. For example, | |
monetary values might use a dot as decimal separator (Fr. 23.50), while | |
measurements might use a comma (22,5 m). Django's localization system cannot | |
handle such context-specific formats automatically. | |
The locale format provided by Django follows common IT practices in Switzerland, | |
using a dot as the decimal separator and a single quote as the thousand | |
separator, matching the behavior of major operating systems and applications | |
in the region. | |
For Swiss government publication guidelines and additional context, see: | |
- https://www.bk.admin.ch/bk/de/home/dokumentation/sprachen/hilfsmittel-textredaktion/schreibweisungen.html | |
- https://de.wikipedia.org/wiki/Dezimaltrennzeichen#Schweiz | |
The Swiss number formatting traditionally varies depending on context. For | |
example, monetary values may use a dot as decimal separator (``Fr. 23.50``), | |
while measurements often use a comma (``22,5 m``). Django’s localization system | |
does not support such context-specific variations automatically. | |
Django follows the commonly accepted IT conventions for Swiss locales. These | |
use a dot as the decimal separator and a space as the thousands separator, | |
consistent with the behavior of major operating systems and software | |
applications used in Switzerland. |
I think I wouldn't add the linked references (partly because these are in German and I can't imagine we need to add more information here)
Trac ticket number
ticket-35095
Branch description
Per Swiss IT conventions, use dot (.) as decimal separator and single quote (')
as thousand separator. This aligns with common practices in Swiss operating
systems and applications.
Document context-specific formatting limitations:
Since Django cannot handle context-specific formats, follow the more common
IT standard format that uses dot as decimal separator.
References:
Checklist
main
branch.