Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Aug 06, 2021 06:58 AM
I need several zeros before my number in a number field. Any way to accomplish this without writing code? I numbered and filled, then changed it over to text field, but now I have to add the zeros to all the numbered cells.
So two questions:
Can I append zeros to the text field cells numbers automatically or
Can I get a numbering field to recognize zeros before the integer?
Thanks!
Aug 06, 2021 07:09 AM
Hi @Bethany_Hacker and welcome to the community!
You could use a formula field field, based on the number you entered, to add the zeros, but it can’t be formatted as a number field.
eg: "00000" & Number
Not in a number field as far as I know.
Aug 06, 2021 10:48 AM
Welcome to the Airtable community!
If you have a number field with an integer, and you want to pad it with leading zeros to get a text string that always has the same number of digits, you can use a formula field.
IF(
{number},
CONCATENATE(
REPT(
"0",
12 - LEN({number} & "")
),
{number}
)
)
If you have a text string that is an integer with leading zeros, you can convert it back to a number with a formula field.
VALUE({Number with Leading Zeros})
or
IF(
{Number with Leading Zeros},
VALUE({Number with Leading Zeros})
)