4 Replies Latest reply on Mar 14, 2011 10:25 AM by julieFrith

    formatting numbers...

    julieFrith

      Title

      formatting numbers...

      Post

      hi everyone. 

      wonder if you can help (again!)

      I need to get filemaker to automatically format a number but not sure how to go about it...

      the number must alway display as 3 digits. eg. for number 1 it would display as 001, for number 12, it would display as 012 and for number 339 it would display as 339. 

      can anyone help how i would go about this. 

      Thanks

      Jules

        • 1. Re: formatting numbers...
          Abhaya

          Hello Julie,

          Just write  a script  and attached it with that field  by trigger(object save)

          if(notempty(field))
            if (length(field)<3)
              set var(i=1)
              Loop
               Exit loop(length(field)=3)
               set field(field;value:"0"& field)
               i++
              End loop
             End if
          End if

           i think After this you must get your answer.

          • 2. Re: formatting numbers...
            raybaudi

            Hi

            The field must be a text type field and must have this calculation into its option of auto-entering a value:

            Right ( "000" & Self ; 3 )

            • 3. Re: formatting numbers...
              julieFrith

              Brilliant, Thank you. 

              J

              • 4. Re: formatting numbers...
                julieFrith

                i've already been helped with a number formatting script but i got my original question wrong so i hope you may all be able to help again. 

                I need to create a script that will generate a certain number of new records. However, the records need to be formatted as follows...

                If i need 5 new records - they will format as record number... 1,2 3, 4, 5

                If i need 15 new records - they will format as record number... 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11 etc

                If i need 115 new records - they will format as 01.... 011.... 115... 

                Any help would be appreciated, as always. 

                Thanks

                Jules