Re: (tables) Rounding numbers for output

0 views
Skip to first unread message

argu...@googlemail.com

unread,
Jun 13, 2009, 6:44:48 PM6/13/09
to Django Apps
Please excuse the multi-post, the django apps goolge groups page was not updating.

On Jun 14, 2009 12:41am, BlGene <argu...@googlemail.com> wrote:
> Is there an easy way to round float numbers when tables are displayed
>
> as html?
>
>
>
> One overengineered and possibly generally useful way  would be to have
>
> the option of specifying a function for each column that lets you
>
> iterate over it to format the output the way you want it. This would
>
> enable a little bit of logic that is not possible in the template and
>
> could be used for things like createing urls from ids,which is
>
> possible in the template, rounding numbers and abbreviateing text ect.
>
> It would be assumed that the output is so simmilar to the original
>
> value so that there is no need for special sorting.

BlGene

unread,
Jun 13, 2009, 6:41:17 PM6/13/09
to Django Apps

Navin Kabra

unread,
Jun 15, 2009, 3:37:54 AM6/15/09
to djang...@googlegroups.com
> Is there an easy way to round float numbers when tables are displayed
> as html?

Check out the built-in "floatformat" template filter.

Reply all
Reply to author
Forward
0 new messages