strange problem with floatformat

5 views
Skip to first unread message

jonathan

unread,
Sep 26, 2009, 5:44:17 AM9/26/09
to Django users
Hi, I am having a strange problem with floatformat (filter) and I
wonder if anyone else has seen it.

I am using google app engine and am storing decimal.Decimal objects in
the datastore that I am displaying in a template as money values so I
am doing foo.methodThatReturnsDecimal|floatformat:2.

The problem is that it doesn't work... but it does work if I open up a
shell... I don't understand why. I was wondering if it could be to do
with the django implementation of decimal

The behaviour I am seeing is: Decimal("10") passed to floatformat:2
displays on the page as "10". Where I expect to see "10.00".

Does anyone have any ideas what might be going on?

j

jonathan

unread,
Sep 27, 2009, 10:54:46 PM9/27/09
to Django users
Ha no one else seen this problem, or have any idea how it might
happen?
Reply all
Reply to author
Forward
0 new messages