Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ answer newbie questions, and generally made Django that much better:
Andy Dustman <farcepest@gmail.com>
Andy Gayton <andy-django@thecablelounge.com>
andy@jadedplanet.net
Annabelle Wiegart
Anssi Kääriäinen <akaariai@gmail.com>
ant9000@netwise.it
Anthony Briggs <anthony.briggs@gmail.com>
Expand Down
8 changes: 3 additions & 5 deletions django/conf/locale/de_CH/formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@
"%d.%m.%Y %H:%M", # '25.10.2006 14:30'
]

# these are the separators for non-monetary numbers. For monetary numbers,
# the DECIMAL_SEPARATOR is a . (decimal point) and the THOUSAND_SEPARATOR is a
# ' (single quote).
# For details, please refer to the documentation and the following link:
# https://www.bk.admin.ch/bk/de/home/dokumentation/sprachen/hilfsmittel-textredaktion/schreibweisungen.html
# Swiss number formatting can vary based on context (e.g. Fr. 23.50 vs 22,5 m).
# Django does not support context-specific formatting and uses generic
# separators.
DECIMAL_SEPARATOR = ","
THOUSAND_SEPARATOR = "\xa0" # non-breaking space
NUMBER_GROUPING = 3
4 changes: 4 additions & 0 deletions django/conf/locale/fr_CH/formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
"%d/%m/%Y %H:%M:%S.%f", # '25/10/2006 14:30:59.000200'
"%d/%m/%Y %H:%M", # '25/10/2006 14:30'
]

# Swiss number formatting can vary based on context (e.g. Fr. 23.50 vs 22,5 m).
# Django does not support context-specific formatting and uses generic
# separators.
DECIMAL_SEPARATOR = ","
THOUSAND_SEPARATOR = "\xa0" # non-breaking space
NUMBER_GROUPING = 3
19 changes: 10 additions & 9 deletions docs/topics/i18n/formatting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,13 @@ Limitations of the provided locale formats
Some locales use context-sensitive formats for numbers, which Django's
localization system cannot handle automatically.

Switzerland (German)
--------------------

The Swiss number formatting depends on the type of number that is being
formatted. For monetary values, a comma is used as the thousand separator and
a decimal point for the decimal separator. For all other numbers, a comma is
used as decimal separator and a space as thousand separator. The locale format
provided by Django uses the generic separators, a comma for decimal and a space
for thousand separators.
Switzerland (German, French)
----------------------------

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.

The locale format provided by Django uses the generic separators, a comma for
decimal and a space for thousand separators.