2 Replies Latest reply: Feb 14, 2012 6:47 PM by Abraham Deme RSS

    Number Format / Text Object

    Abraham Deme

      Hi everyone, just wanted to ask, i've looked around in the forum but couldn't find this, i apologise if it's there already.

       

      Wanted to know how to format a number in a text object. As in 200,000.

       

      Cheers.

        • Number Format / Text Object
          Stefan Wühl

          To format a number, use num() function.

           

          From the Help:

           

          num(expression [ , format-code [ , decimal-sep [ , thousands-sep ] ] ] )

          The num function formats the expression numerically according to the string given as format-code. Decimal separator and thousands separator can be set as third and fourth parameters. If the parameters 2-4 are omitted, the number format set in the operating system is used.

          Example:

          The examples below assume the two following operating system settings:

          Default setting 1

          Default setting 2

          Number format

          # ##0,#

          #,##0.#

           

          num( A, '0.0' ) where A=35648.375 returns:

          Setting 1

          Setting 2

          String

          35 648 375

          35648.375

          Number

          35648375

          35648.375

           

          num( A, '#,##0.##', '.' , ',' ) where A=35648 returns:

          Setting 1

          Setting 2

          String

          35,648.00

          35,648.00

          Number

          35648

          35648

           

          num( pi( ), '0,00' ) returns:

          Setting 1

          Setting 2

          String

          3,14

          003

          Number

          3.141592653

          3.141592653