Re: [web2py] Re: represents currency format

2015-01-27 Thread Niphlod
whoopsie, since you passed a lambda that takes *value, row* you should have passed *list.UnitPrice, list* On Tuesday, January 27, 2015 at 3:44:07 PM UTC+1, Omi Chiba wrote: > > I got this error... > (() takes exactly 2 arguments (1 > given)) > > Render also looks complicated to me so I will just

Re: [web2py] Re: represents currency format

2015-01-27 Thread Omi Chiba
I got this error... (() takes exactly 2 arguments (1 given)) Render also looks complicated to me so I will just use the JS Massimo suugested. Thank you both!! On Monday, January 26, 2015 at 6:01:08 PM UTC-6, Niphlod wrote: > > in the view, you have > > {{=list.UnitPrice}} > > use instead > >

Re: [web2py] Re: represents currency format

2015-01-26 Thread Massimo Di Pierro
Notice this can also be done in JS and it will make your code cleaner: http://numeraljs.com/ On Monday, 26 January 2015 18:01:08 UTC-6, Niphlod wrote: > > in the view, you have > > {{=list.UnitPrice}} > > use instead > > {{=db.KR_Product.UnitPrice.represent(list.UnitPrice)}} > > should work with

Re: [web2py] Re: represents currency format

2015-01-26 Thread Niphlod
in the view, you have {{=list.UnitPrice}} use instead {{=db.KR_Product.UnitPrice.represent(list.UnitPrice)}} should work without issues. or read about render() here -- Resources: -

Re: [web2py] Re: represents currency format

2015-01-26 Thread Omi Chiba
Can you give me more details? I'm not sure if directly call it from view or controller. I apprecite if you can provide a sample code with the following. db.KR_Product.UnitPrice.represent = lambda value, row: '$ %.2f' % (0.0 if value == None else value) On Mon, Jan 26, 2015 at 4:56 PM, Niphlod wr

[web2py] Re: represents currency format

2015-01-26 Thread Niphlod
if you're not using web2py's facilities (SQLTABLE, grid, rows.render(), etc), you have to call represent directly {{=db.KR_Product.UnitPrice.represent(list.UnitPrice)}} On Monday, January 26, 2015 at 11:39:07 PM UTC+1, Omi Chiba wrote: > > I want to show the UnitPrice like $1,000,00 but it sho