Skip to content

Commit

Permalink
Fixed #14403 -- Provided some extra resources on the difference betwe…
Browse files Browse the repository at this point in the history
…en FloatField and DecimalField in the model field reference. Thanks to typeshige for the report and trebor74hr and dmedvinsky for the draft patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15090 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
Gabriel Hurley committed Dec 29, 2010
1 parent cd977b9 commit 7f3210e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/ref/models/fields.txt
Expand Up @@ -455,6 +455,12 @@ decimal places::


The admin represents this as an ``<input type="text">`` (a single-line input). The admin represents this as an ``<input type="text">`` (a single-line input).


.. note::

For more information about the differences between the
:class:`FloatField` and :class:`DecimalField` classes, please
see :ref:`FloatField vs. DecimalField <floatfield_vs_decimalfield>`.

``EmailField`` ``EmailField``
-------------- --------------


Expand Down Expand Up @@ -661,6 +667,20 @@ A floating-point number represented in Python by a ``float`` instance.


The admin represents this as an ``<input type="text">`` (a single-line input). The admin represents this as an ``<input type="text">`` (a single-line input).


.. _floatfield_vs_decimalfield:

.. admonition:: ``FloatField`` vs. ``DecimalField``

The :class:`FloatField` class is sometimes mixed up with the
:class:`DecimalField` class. Although they both represent real numbers, they
represent those numbers differently. ``FloatField`` uses Python's ``float``
type internally, while ``DecimalField`` uses Python's ``Decimal`` type. For
information on the difference between the two, see Python's documentation on
`Decimal fixed point and floating point arithmetic`_.

.. _Decimal fixed point and floating point arithmetic: http://docs.python.org/library/decimal.html


``ImageField`` ``ImageField``
-------------- --------------


Expand Down

0 comments on commit 7f3210e

Please sign in to comment.