# Adding leading zeros to serialnumber

**URL:** <https://connect.superhuman.com/t/adding-leading-zeros-to-serialnumber/45323>\
**Category:** Ask the Community\
**Created:** [December 23, 2023, 10:23pm UTC](https://connect.superhuman.com/t/adding-leading-zeros-to-serialnumber/45323 "2023-12-23T22:23:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Conijn](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/peter_conijn/32/39727_2.png) [@Peter\_Conijn](https://connect.superhuman.com/u/Peter_Conijn)\
**Post date:** [December 23, 2023, 10:23pm UTC](https://connect.superhuman.com/t/adding-leading-zeros-to-serialnumber/45323/1 "2023-12-23T22:23:25Z")

</div>

Hi There!

After searching the forum and coming to some awseome ideas, i’m really close (I hope)

I have a button which generates a sequential number, which is in the column “CMPR”. Now I would like to add leading zero’s to the serialnumber. The problem comes when the number changes form 9 to 10. Now my serial number is 5 digits and I want to limit to 4. Does anybody have a idea?

The formula I use in the second column is this:

> Concatenate(“CMPR”,“000”,thisRow.CMPR)

---

<div class="post-metadata">

**Author:** ![Peter\_Conijn](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/peter_conijn/32/39727_2.png) [@Peter\_Conijn](https://connect.superhuman.com/u/Peter_Conijn)\
**Post date:** [December 23, 2023, 10:29pm UTC](https://connect.superhuman.com/t/adding-leading-zeros-to-serialnumber/45323/2 "2023-12-23T22:29:47Z")

</div>

Funny thing about researching a solution is thet when typing it out, you stumble across a possible solution and voilá. I just added a third column and used the Leftpad formula. Then in the last column i used Concatenate to add all the parts.

I’m still somewhat in excel mode and making huge formulas, nesting them and so on…

Anyway, thanks for the help 🙂

---

<div class="post-metadata">

**Author:** ![Christiaan\_Huizer](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/christiaan_huizer/32/28269_2.png) [@Christiaan\_Huizer](https://connect.superhuman.com/u/Christiaan_Huizer)\
**Post date:** [December 24, 2023, 12:03pm UTC](https://connect.superhuman.com/t/adding-leading-zeros-to-serialnumber/45323/3 "2023-12-24T12:03:31Z")

</div>

hi peter,

did you consider the function `Format()`

 ![image](https://global.discourse-cdn.com/coda1/original/3X/f/d/fd4078a8d5d3efa2e898c092fadcedd6a56fd1aa.png)

Enjoy, Cheers, Christiaan

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/system/32/24484_2.png) [@system](https://connect.superhuman.com/u/system)\
**Post date:** [March 23, 2024, 12:04pm UTC](https://connect.superhuman.com/t/adding-leading-zeros-to-serialnumber/45323/4 "2024-03-23T12:04:03Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
