Re: [web2py] SQLTABLE default numeric format

2011-08-18 Thread Bruno Rocha
CORRECTIONl: for field in db.mytable.fields: *field = db.mytable[field]* if field.type == 'double': field.represent = lambda value: "%.2f" % value

Re: [web2py] SQLTABLE default numeric format

2011-08-18 Thread Bruno Rocha
No, but you have some options: *1. field representation* # apply to all fields for some table, do it before the creation of SQLTABLE for field in db.mytable.fields: if field.type == 'double': field.represent = lambda value: "%.2f" % value *2. Use Virtual Fields* *3. Manipulate the o

[web2py] SQLTABLE default numeric format

2011-08-18 Thread Michael Ellis
This feels like a dumb question but I haven't found the answer with Google or by searching the web2py book, so here goes: If I have a view with {{=SQLTABLE(rows,headers=headers)}} where rows is the result of a select, is there any way to specify a default numeric precision, e.g. '%0.2f' to be appl