Henrik,
Not sure if this is what you are after but I think it depends on how many leading zeros you want.
I use a Number Attribute for ApplicationNumber that is autoincremented and have the format as #00000.
So, number 1 displays as 00001
Number 456 displays as 00456