3 Replies Latest reply on May 7, 2010 12:21 PM by philmodjunk

    Formating numbers

    DanBarkley

      Title

      Formating numbers

      Post

      I am using Filemaker 10.0v3 on a MacBook Pro OS 10.6.3.

       

      I want to be able to enter a series of numbers and force a specific format to them.

       

      Example: Enter 123456789, Show 12.345.678-9.

       

      How do I do this?

       

      Thank you.

        • 1. Re: Formating numbers
          davidanders

          Formatting a number field the way you show, means it must be a text field.

          Is the number of digits constant?

          One way would be to use a number field, verified to contain the required number of digits.

          The formatted (text) field would be calculated with left, middle, and right with the symbols inserted.

          • 2. Re: Formating numbers
            DanBarkley

            Yes. The number of characters is constant. There is no real reason that it has to be a number field though, since there is never any need to calculate anything.

            • 3. Re: Formating numbers
              philmodjunk

              This expression would serve:

               

              Let ( n = Filter (yourfield ; "0123456789") ; Left ( n ; 2 ) & "." & Middle ( n ; 3 ; 3 ) & "." & Middle ( n ; 6 ; 3 ) & "-" & Right ( n ; 1 ) )

               

              You could even set this up as an auto-entered calculation with "self" in place of "yourfield" on your original data field, just be sure to clear the "do not replace existing value..." check box if you do.