Shoot, strike that. You had it right; except for the second parameter
for the labelFunction:

private function basePriceLabel(item:Object,
column:DataGridColumn):String {
  return fBasePriceEntry.format(item.basePrice);
}

-TH

--- In flexcoders@yahoogroups.com, "Tim Hoff" <[EMAIL PROTECTED]> wrote:
>
>
> Hi Joshua,
>
> Not tested, but you can try this:
>
> private function basePriceLabel(item:Object):Number{
> return Number(fBasePriceEntry.format(item.basePrice));
> }
>
> -TH
>
> --- In flexcoders@yahoogroups.com, "Joshua Partogi" joshua.java@
> wrote:
> >
> > Dear all,
> >
> > I want to format a number inside a dataGrid column, how do I do
this?
> > I tried using labelFunction as such, but it still doesnt work. Does
> > anyone here have any clue on how to do it?
> > private function basePriceLabel(item:Object):String{
> > return fBasePriceEntry.format(item.basePrice);
> > }
> >
> >
> > <mx:NumberFormatter id="fBasePriceEntry"
> > decimalSeparatorTo="."
> > thousandsSeparatorTo=","
> > useThousandsSeparator="true" />
> >
> > <mx:DataGrid dataProvider="{products}" width="100%" height="100%"
> > id="dataGrid" >
> > <mx:columns>
> > <mx:DataGridColumn labelFunction="basePriceLabel"
> > dataField="basePrice"
> > headerText="{resourceManager.getString('Admin','basePrice')}"
> > textAlign="right"/>
> > </mx:columns>
> > </mx:DataGrid>
> >
> > many thanks in advance
> >
> > --
> > Read my blog: http://joshuajava.wordpress.com/
> > Follow me on twitter: http://twitter.com/jpartogi
> >
>


Reply via email to