On 8/19/07, Greg <[EMAIL PROTECTED]> wrote:
> I have a FloatField called price that stores the price of different
> elements.  When the price is 19.99, 19.79, 19.01 etc... everything is
> displayed correctly.  However, when I have a price of 19.00.  The
> price when viewed in a browser is just 19.  Is there anyway that I can
> have it display the two zeros so that it is displayed as 19.00?

If you require two places of precision, regardless of whether they're
technically necessary to convey the value (e.g., if you always want
19.00 instead of 19, and 19.50 instead of 19.5), a FloatField is not
appropriate. Instead you want a DecimalField with "decimal_places" set
to 2:

http://www.djangoproject.com/documentation/model-api/#decimalfield


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

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

Reply via email to