Author: gabrielhurley
Date: 2010-12-28 18:03:02 -0600 (Tue, 28 Dec 2010)
New Revision: 15090

Modified:
   django/trunk/docs/ref/models/fields.txt
Log:
Fixed #14403 -- Provided some extra resources on the difference between 
FloatField and DecimalField in the model field reference. Thanks to typeshige 
for the report and trebor74hr and dmedvinsky for the draft patch.

Modified: django/trunk/docs/ref/models/fields.txt
===================================================================
--- django/trunk/docs/ref/models/fields.txt     2010-12-28 23:25:28 UTC (rev 
15089)
+++ django/trunk/docs/ref/models/fields.txt     2010-12-29 00:03:02 UTC (rev 
15090)
@@ -455,6 +455,12 @@
 
 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``
 --------------
 
@@ -661,6 +667,20 @@
 
 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``
 --------------
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to