diff options
| author | Claude Paroz <claude@2xlibre.net> | 2019-09-08 23:25:53 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-09-14 17:25:33 +0200 |
| commit | f452d4232e1c14269bf2f1bd234d6e4ef462dc55 (patch) | |
| tree | 930254b7b3e2c0695b37c0dc28262fad867884ce /docs | |
| parent | 1864d61d6c20e275e9196deff6c8f3de78fcee3d (diff) | |
[2.2.x] Fixed #29823 -- Doc'd limitation of DecimalField on SQLite.
Backport of b8dff52f440adfb78b40e19ee8bff45373ca2501 from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/databases.txt | 12 | ||||
| -rw-r--r-- | docs/ref/models/fields.txt | 4 |
2 files changed, 15 insertions, 1 deletions
diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt index 84dce9fa7c..2520e479c3 100644 --- a/docs/ref/databases.txt +++ b/docs/ref/databases.txt @@ -665,6 +665,18 @@ substring filtering. .. _documented at sqlite.org: https://www.sqlite.org/faq.html#q18 +.. _sqlite-decimal-handling: + +Decimal handling +---------------- + +SQLite has no real decimal internal type. Decimal values are internally +converted to the ``REAL`` data type (8-byte IEEE floating point number), as +explained in the `SQLite datatypes documentation`__, so they don't support +correctly-rounded decimal floating point arithmetic. + +__ https://www.sqlite.org/datatype3.html#storage_classes_and_datatypes + "Database is locked" errors --------------------------- diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index 1090d4f66a..5ce3abae72 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -594,7 +594,9 @@ when :attr:`~django.forms.Field.localize` is ``False`` or For more information about the differences between the :class:`FloatField` and :class:`DecimalField` classes, please - see :ref:`FloatField vs. DecimalField <floatfield_vs_decimalfield>`. + see :ref:`FloatField vs. DecimalField <floatfield_vs_decimalfield>`. You + should also be aware of :ref:`SQLite limitations <sqlite-decimal-handling>` + of decimal fields. ``DurationField`` ----------------- |
