Hi Massimo,   Digged into it a little further, and found out that this only 
happens when represent is used.   ##models.py db.define_table('all_values',     
Field('price','decimal(5,2)',requires=IS_DECIMAL_IN_RANGE(0,10,dot=','),represent
 = lambda price,row: '€ %.2f' % price)     )   ## Controller: 
@auth.requires_login() def index():     grid=SQLFORM.grid(db.all_values.id>0)   
  form=grid.element('form')     if form and form.accepted:         
response.flash='Verwerkt'     return dict(grid=grid)   ##view {{extend 
'layout.html'}} {{=grid}}   Screenshot at: 
http://dl.dropbox.com/u/31865598/Schermafdruk.png   But maybe represent is not 
the best approach to get units being displayed??   Grtz,   Freerk

 
 
-----Oorspronkelijk bericht-----
Aan:web2py-users <web2py@googlegroups.com>; 
Van:Massimo Di Pierro <massimo.dipie...@gmail.com>
Verzonden:di 22-11-2011 15:21
Onderwerp:[web2py] Re: Formatting numbers in SQLFORM grid
Can you provide an example? Wat do you mean in list view?

On Nov 22, 6:41 am, Freerk Kalsbeek <fre...@mindswitch.net> wrote:
> Hi,
>
> I'm trying to format numbers according to the dutch standard (decimal
> comma separator).
>
> It is working on view/edit views by adding:
> requires=IS_DECIMAL_IN_RANGE(0,100,dot=',') to the numeric field.
> But in list views the numbers are displayed with a decimal dot.
>
> How can I change that?
>
> Regards,
> Freerk

Reply via email to