3 Replies Latest reply on Jul 24, 2009 9:12 PM by GordonSmith

    How can I use thousand spearator ?

    Sebmex

      I have a Datagrid with data from a webservice coming in (integer format displayed ("int) in Data Type property for this specific field).

       

      The numbers are displayed and aligned left (like if it were text). I managed to find the Advanded tab in "Configure Columns" but it's only enforcing left, center or right alignment.

       

      What I am looking to do is seperate this number 100000 into 100 000.

       

      Where can i paramter this ?

       

      thank you

       

      Sebmex

        • 1. Re: How can I use thousand spearator ?
          GordonSmith Level 4

          Use the labelFunction property of DataGridColumn, and implement the label function using NumberFormatter, which lets you specify a thousands separator.

           

          Gordon Smith

          Adobe Flex SDK Team

           

          • 2. Re: How can I use thousand spearator ?
            Sebmex Level 1

            ok, so that's a coding solution, nothing can be done in the Design interface to do so ?

             

            I found the labelFunction property in the advanced tab of Column configuration for my Datagrid, but no combo to choose from, and no trace of a Number Formater in the Design view neither.

             

            I guess this is a property you call directly in the code, right ?

            • 3. Re: How can I use thousand spearator ?
              GordonSmith Level 4

              Yes, this would require coding since that formatting functionality hasn't been built in to the DataGrid component... it's been factored into a separate NumberFormatter class.

               

              You set a DataGridColumn's labelFunction to a method that you write that will take the data item and format it for display. See the ASDoc for what this function is passed and what it should return.

               

              Gordon Smith

              Adobe Flex SDK Team