Re: How to convert 92.5698 to 92.57

2007-10-17 Thread Karen Tracey
On 10/17/07, Greg <[EMAIL PROTECTED]> wrote: > Is there documentation that talks about .2f? Would it be under Python > or Django documentation? That's just Python. See: http://docs.python.org/lib/typesseq-strings.html I'm still having the problem with the admin though. I guess it's not >

Re: How to convert 92.5698 to 92.57

2007-10-17 Thread Karen Tracey
Try changing: phonemes = "%s \n\n %s" % (pr, myorder) to: phonemes = "%.2f \n\n %s" % (pr, myorder) Karen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: How to convert 92.5698 to 92.57

2007-10-17 Thread Greg
Doug, I'm sending the email from my view so I can't use a template filter like 'stringformt'. I don't call a template to send my email. Here is my code view: o = Order() o.b_name = request.session['orderdetails']['b_firstname'] + " " + request.session['orderdetails']['b_lastname'] o.b_address

Re: How to convert 92.5698 to 92.57

2007-10-17 Thread Doug Van Horn
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

Re: How to convert 92.5698 to 92.57

2007-10-17 Thread Greg
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

Re: How to convert 92.5698 to 92.57

2007-10-17 Thread Doug Van Horn
On Oct 16, 11:19 pm, Greg <[EMAIL PROTECTED]> wrote: > Michael, > Yea I'm already using stringformat in my template. However, in my > view code is where I create the order. When the order is added in the > view and I then look at it in the admin the price is displayed as 74.0 > instead of

Re: How to convert 92.5698 to 92.57

2007-10-16 Thread Greg
Michael, Yea I'm already using stringformat in my template. However, in my view code is where I create the order. When the order is added in the view and I then look at it in the admin the price is displayed as 74.0 instead of 74.00. Here is part of my view code: p = float(a['choice']) *

Re: How to convert 92.5698 to 92.57

2007-10-16 Thread Michael
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

Re: How to convert 92.5698 to 92.57

2007-10-16 Thread Greg
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)

Re: How to convert 92.5698 to 92.57

2007-10-15 Thread LorenDavie
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

How to convert 92.5698 to 92.57

2007-10-15 Thread Greg
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 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google