Skip to content

Commit 71267c9

Browse files
annalaurawjacobtylerwalls
authored andcommitted
[5.2.x] Fixed #35095 -- Clarified Swiss number formatting in docs/topics/i18n/formatting.txt.
Co-authored-by: Ahmed Nassar <a.moh.nassar00@gmail.com> Backport of 7423918 from main.
1 parent 9b37bd5 commit 71267c9

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ answer newbie questions, and generally made Django that much better:
9696
Andy Dustman <farcepest@gmail.com>
9797
Andy Gayton <andy-django@thecablelounge.com>
9898
andy@jadedplanet.net
99+
Annabelle Wiegart
99100
Anssi Kääriäinen <akaariai@gmail.com>
100101
ant9000@netwise.it
101102
Anthony Briggs <anthony.briggs@gmail.com>

django/conf/locale/de_CH/formats.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@
2525
"%d.%m.%Y %H:%M", # '25.10.2006 14:30'
2626
]
2727

28-
# these are the separators for non-monetary numbers. For monetary numbers,
29-
# the DECIMAL_SEPARATOR is a . (decimal point) and the THOUSAND_SEPARATOR is a
30-
# ' (single quote).
31-
# For details, please refer to the documentation and the following link:
32-
# https://www.bk.admin.ch/bk/de/home/dokumentation/sprachen/hilfsmittel-textredaktion/schreibweisungen.html
28+
# Swiss number formatting can vary based on context (e.g. Fr. 23.50 vs 22,5 m).
29+
# Django does not support context-specific formatting and uses generic
30+
# separators.
3331
DECIMAL_SEPARATOR = ","
3432
THOUSAND_SEPARATOR = "\xa0" # non-breaking space
3533
NUMBER_GROUPING = 3

django/conf/locale/fr_CH/formats.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
"%d/%m/%Y %H:%M:%S.%f", # '25/10/2006 14:30:59.000200'
2828
"%d/%m/%Y %H:%M", # '25/10/2006 14:30'
2929
]
30+
31+
# Swiss number formatting can vary based on context (e.g. Fr. 23.50 vs 22,5 m).
32+
# Django does not support context-specific formatting and uses generic
33+
# separators.
3034
DECIMAL_SEPARATOR = ","
3135
THOUSAND_SEPARATOR = "\xa0" # non-breaking space
3236
NUMBER_GROUPING = 3

docs/topics/i18n/formatting.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,13 @@ Limitations of the provided locale formats
188188
Some locales use context-sensitive formats for numbers, which Django's
189189
localization system cannot handle automatically.
190190

191-
Switzerland (German)
192-
--------------------
193-
194-
The Swiss number formatting depends on the type of number that is being
195-
formatted. For monetary values, a comma is used as the thousand separator and
196-
a decimal point for the decimal separator. For all other numbers, a comma is
197-
used as decimal separator and a space as thousand separator. The locale format
198-
provided by Django uses the generic separators, a comma for decimal and a space
199-
for thousand separators.
191+
Switzerland (German, French)
192+
----------------------------
193+
194+
The Swiss number formatting traditionally varies depending on context. For
195+
example, monetary values may use a dot as decimal separator (``Fr. 23.50``),
196+
while measurements often use a comma (``22,5 m``). Django’s localization system
197+
does not support such context-specific variations automatically.
198+
199+
The locale format provided by Django uses the generic separators, a comma for
200+
decimal and a space for thousand separators.

0 commit comments

Comments
 (0)