On Oct 17, 9:44 am, Greg <[EMAIL PROTECTED]> wrote:
> Doug,
> Thanks for the reply. It's weird, because in my admin when I show the
> amount in my list_display (list_display = ('b_name', 'thirdtime',
> 'amount', 'customer', 'id')). I see the two zeroes. However, when I
> drill down on a specific record I only see one zero. This is a
> problem because in my view I send an email to the customer. The email
> contains the price of the order, and If the price of the order is
> 74.00...I don't want them to see 74.0.
>
> Thanks for any help
If you're only concern is what goes into that email (presumably a
Django template), then you can simply format the value as Michael
specified above: {{ order.amount|stringformat:".2f" }}.
If you're unhappy with how the Admin is displaying the value for edit
in a form field, I believe you'll need to look into creating your own
custom AddManipulator and ChangeManipulator for your Order object.
The oldforms documentation has details on that.
Again, though, if you're only concerned with the output in a template
(your email), then just use the stringformat filter.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---