You can use "stringformat" in template:
{{ price|stringformat:".2f"}}
On 10/17/07, Greg <[EMAIL PROTECTED]> wrote:
>
> Loren,
> Yes I got that working However, I'm still having the problem when the
> order amount decimal value is .00. So, if the order amount is 74.00.
> I only see 74.0 in the admin. My admin field is setup this way:
>
> amount = models.DecimalField("Order Amount", max_digits=6,
> decimal_places=2)
>
> Thanks
>
>
>
>
> On Oct 15, 10:19 pm, LorenDavie <[EMAIL PROTECTED]> wrote:
> > Hi Greg,
> >
> > Within the view you can just use python's built in round function
> >
> > >>> round(92.5698,2)
> >
> > 92.57
> >
> > The full documentation is here:
> >
> > http://docs.python.org/lib/built-in-funcs.html
> >
> > Look for the "round()" function - the second argument is the number of
> > decimal places you wish to retain.
> >
> > Hope that helps.
> >
> > On Oct 15, 11:06 pm, Greg <[EMAIL PROTECTED]> wrote:
> >
> > > Hello,
> > > I have a view that gets a number. It's value is 92.5698, I want to
> > > find out how to convert that number to two decimal places 92.57 from
> > > within the view.
> >
> > > Thanks
>
>
> >
>
--
--
Michael
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---