untested
db.Product.List_Price.represent = lambda value, row: XML(DIV('$ %.2f' % (0.0 if
value == None else value),_style='text-align: right;'))
On 9/28/2011 10:42 AM, Omi Chiba wrote:
Um, actually one more question.
Now I have two represent and riht now either one of them work but not
both. How I can combine them together ??
# Currency format
db.Product.List_Price.represent = lambda value, row: '$ %.2f' % (0.0
if value == None else value)
# text-align: right
db.Product.List_Price.represent = lambda value, row:
XML(DIV(value,_style='text-align: right;'))
On Sep 28, 10:37 am, Omi Chiba<[email protected]> wrote:
Wow ! This is what I want.
Thanks !!
On Sep 28, 9:53 am, Massimiliano<[email protected]> wrote:
Is there a reason that you want to format on the grid?
because you can do it in field.represent:
db.yourtable.yourfield = lambda value, row: '$ %.2f' % (0.0 if value == None
else value)
On Wed, Sep 28, 2011 at 4:48 PM, Omi Chiba<[email protected]> wrote:
Can we format 500.00 to $500.00 on smartgrid ?
--
Massimiliano