1 Reply Latest reply on May 14, 2010 12:26 PM by PegLeg7

    Formatting labels

    PegLeg7 Level 1

      I have a label as shown below:

      <mx:Label text="total Cost" {data.TOTAL_COST}"/>

      Currently it looks into a table and brings back a text string simular to 34000000.  I need to format that string into a readable dollar amount such as $34,000,000.  I am using labelFunction to input the same text into a datagridcolumn but cannot figure out how to format it for a label.


      If anyone can set me straight I would appriciate it.



      Richard Krell

        • 1. Re: Formatting labels
          PegLeg7 Level 1

          Figured it out myself.  It wasn't anything I was doing wrong as far as using the CurrencyFormatter and then inputting it into a label as shown below.  But another element of my problem that I didn't realize was that the label was inside a <mx:component> so the formatter had to be there also.  Everything works fine now.



          <mx:Label text="Total Cost: {infoCurrencyFormatter.format(data.TOTAL_COST)}"/>