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
>
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
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
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
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
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
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']) *
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
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)
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
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
11 matches
Mail list logo