Count leading zero

How can I get the "series"component to count with leading zeros?

Or how can I achieve leading zeros in a different way without blowing up the definition?

You have to concatenate text and use those numbers as text.

I tried that before but my numbers need to keep the same overall digit count. look what happens with numbers bigger than 9 or 09:

a little python will help:

source: python - Display number with leading zeros - Stack Overflow

1 Like

this will give 0’s before everything. You can do it with the Exprsion component and get the Format you require.

3 Likes

Both work, thanks a lot!
I need it for consisten filename output.

I forgot there is a dedicated component for this now. [Format]

You can read up more on the notation masks here: https://www.grasshopper3d.com/forum/topics/formatting-numbers-in-grasshopper

2 Likes

Even better, thanks a lot!