1 Reply Latest reply on Aug 11, 2012 7:56 PM by davidanders

    Add zeros to Numbers



      Add zeros to Numbers


      I am putting a number into a field to get a found set.

      The "numbers" in the records are all 6 digets long.

      In this file some of the numbers are not that large, so it adds zeros in front to make them 6 long.

      The number im imputing is 574.

      The file is looking for 000574.

      My logict is find the first number that is greater than or equal to... 574.

      How do i add 3 zeros to the front of 574 to come up with a number it will recognize.

      I tried *574 that got me the number, but in this segment of the file there are 2263 records. That won't work for all situations when my process/script creates a number different than 574. The numbers in the file are not sequential.


        • 1. Re: Add zeros to Numbers

          Right ( "000000"  & yourField; 6 )

          A Google seems to think that would work...

          Home > Reference > Functions reference > Text functions > Right

          Purpose    Returns the specified numberOfCharacters in text, counting from the right.
          Format     Right(text;numberOfCharacters)
          text - any text expression or text field
          numberOfCharacters - any numeric expression or field containing a number
          Data type returned    text
          Originated in    FileMaker Pro 6.0 or earlier
          Right(“Manufacturing”;4) returns ring.
          Right(Name;Length(Name) - Position(Name;“ “;1;1)) returns Cannon, when the Name field contains Michelle Cannon.
          Right(SerialNumber;3) & Upper(Left(LastName;4)) returns 187FERR when the SerialNumber text field contains 00-48-187 and LastName contains Ferrini.