Skip to main content

Leading Zeros for Number Field

  • March 27, 2022
  • 7 replies
  • 36 views

Forum|alt.badge.img+15

I need leading zeros for the Number field for shot lists for video. Leading zeros “1” would be written as “01” or “001”. This is useful for ordering files by name, inventory SKU’s, etc.

7 replies

Forum|alt.badge.img+16
  • Inspiring
  • March 28, 2022

Does it need to be a number type field? Can you use a text field instead? You can convert it back to a number later if needed.


Forum|alt.badge.img+15
  • Author
  • Inspiring
  • March 30, 2022

Does it need to be a number type field? Can you use a text field instead? You can convert it back to a number later if needed.


In my view, the purpose of using a tool like Airtable is recognizing data for its particular function to harness it. Sure, I could use a text field. But then Airtable loses its powers and I might as well use Google Sheets instead. For example, if I want to number sequentially from 1 to 10, with a numbers field I can use the fill handle to do this within seconds, rather than manually filling out each field.

Airtable Support | Quickly filling cells using fill handle | Continuing a series of data


Forum|alt.badge.img+16
  • Inspiring
  • April 7, 2022

In my view, the purpose of using a tool like Airtable is recognizing data for its particular function to harness it. Sure, I could use a text field. But then Airtable loses its powers and I might as well use Google Sheets instead. For example, if I want to number sequentially from 1 to 10, with a numbers field I can use the fill handle to do this within seconds, rather than manually filling out each field.

Airtable Support | Quickly filling cells using fill handle | Continuing a series of data


I see what you are saying and I don’t disagree.

How do you do this in Google Sheets with the column formatted as a Number?


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • April 7, 2022

Use a formula field to pad the number with leading zeros.

For example, if you want a total of three digits, and are sure that your initial number is three digits or less…

CONCATENATE(
  REPT(
    "0",
    3 - LEN({number} & "")
  ),
  {number}
)

Forum|alt.badge.img+15
  • Author
  • Inspiring
  • April 8, 2022

Use a formula field to pad the number with leading zeros.

For example, if you want a total of three digits, and are sure that your initial number is three digits or less…

CONCATENATE(
  REPT(
    "0",
    3 - LEN({number} & "")
  ),
  {number}
)

I appreciate the suggestion. I input the formula as-is but am getting an error message:

Sorry, there was a problem saving this field. Unknown field names: number

Was I supposed to modify any words in the formula?


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • April 9, 2022

I appreciate the suggestion. I input the formula as-is but am getting an error message:

Sorry, there was a problem saving this field. Unknown field names: number

Was I supposed to modify any words in the formula?


You need to replace {number} so that it matches the name of your field.


Forum|alt.badge.img+15
  • Author
  • Inspiring
  • April 9, 2022

You need to replace {number} so that it matches the name of your field.


Thank you for clarifying, the formula now works! But I guess it’s dependent on the {X} column to produce the leading zero results.