mirror of
https://github.com/django/django.git
synced 2025-10-25 14:46:09 +00:00
[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 7423918125 from main.
This commit is contained in:
committed by
Jacob Walls
parent
9b37bd5fe7
commit
71267c97db
1
AUTHORS
1
AUTHORS
@@ -96,6 +96,7 @@ answer newbie questions, and generally made Django that much better:
|
|||||||
Andy Dustman <farcepest@gmail.com>
|
Andy Dustman <farcepest@gmail.com>
|
||||||
Andy Gayton <andy-django@thecablelounge.com>
|
Andy Gayton <andy-django@thecablelounge.com>
|
||||||
andy@jadedplanet.net
|
andy@jadedplanet.net
|
||||||
|
Annabelle Wiegart
|
||||||
Anssi Kääriäinen <akaariai@gmail.com>
|
Anssi Kääriäinen <akaariai@gmail.com>
|
||||||
ant9000@netwise.it
|
ant9000@netwise.it
|
||||||
Anthony Briggs <anthony.briggs@gmail.com>
|
Anthony Briggs <anthony.briggs@gmail.com>
|
||||||
|
|||||||
@@ -25,11 +25,9 @@ DATETIME_INPUT_FORMATS = [
|
|||||||
"%d.%m.%Y %H:%M", # '25.10.2006 14:30'
|
"%d.%m.%Y %H:%M", # '25.10.2006 14:30'
|
||||||
]
|
]
|
||||||
|
|
||||||
# these are the separators for non-monetary numbers. For monetary numbers,
|
# Swiss number formatting can vary based on context (e.g. Fr. 23.50 vs 22,5 m).
|
||||||
# the DECIMAL_SEPARATOR is a . (decimal point) and the THOUSAND_SEPARATOR is a
|
# Django does not support context-specific formatting and uses generic
|
||||||
# ' (single quote).
|
# separators.
|
||||||
# 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
|
|
||||||
DECIMAL_SEPARATOR = ","
|
DECIMAL_SEPARATOR = ","
|
||||||
THOUSAND_SEPARATOR = "\xa0" # non-breaking space
|
THOUSAND_SEPARATOR = "\xa0" # non-breaking space
|
||||||
NUMBER_GROUPING = 3
|
NUMBER_GROUPING = 3
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ DATETIME_INPUT_FORMATS = [
|
|||||||
"%d/%m/%Y %H:%M:%S.%f", # '25/10/2006 14:30:59.000200'
|
"%d/%m/%Y %H:%M:%S.%f", # '25/10/2006 14:30:59.000200'
|
||||||
"%d/%m/%Y %H:%M", # '25/10/2006 14:30'
|
"%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 = ","
|
DECIMAL_SEPARATOR = ","
|
||||||
THOUSAND_SEPARATOR = "\xa0" # non-breaking space
|
THOUSAND_SEPARATOR = "\xa0" # non-breaking space
|
||||||
NUMBER_GROUPING = 3
|
NUMBER_GROUPING = 3
|
||||||
|
|||||||
@@ -188,12 +188,13 @@ Limitations of the provided locale formats
|
|||||||
Some locales use context-sensitive formats for numbers, which Django's
|
Some locales use context-sensitive formats for numbers, which Django's
|
||||||
localization system cannot handle automatically.
|
localization system cannot handle automatically.
|
||||||
|
|
||||||
Switzerland (German)
|
Switzerland (German, French)
|
||||||
--------------------
|
----------------------------
|
||||||
|
|
||||||
The Swiss number formatting depends on the type of number that is being
|
The Swiss number formatting traditionally varies depending on context. For
|
||||||
formatted. For monetary values, a comma is used as the thousand separator and
|
example, monetary values may use a dot as decimal separator (``Fr. 23.50``),
|
||||||
a decimal point for the decimal separator. For all other numbers, a comma is
|
while measurements often use a comma (``22,5 m``). Django’s localization system
|
||||||
used as decimal separator and a space as thousand separator. The locale format
|
does not support such context-specific variations automatically.
|
||||||
provided by Django uses the generic separators, a comma for decimal and a space
|
|
||||||
for thousand separators.
|
The locale format provided by Django uses the generic separators, a comma for
|
||||||
|
decimal and a space for thousand separators.
|
||||||
|
|||||||
Reference in New Issue
Block a user