### Title

Adding Leading Zeros to a field which uses the random function

### Post

Hi There,

I've created a field which uses a random function to create a number from 1 to 30. However, I would like the field to show a leading zero if the number created is less than 10, in other words it should contain two characters no matter what.

Currently the field is a number field, do I need to change this to a text field?

If so, could someone tell me exactly what the script should look like please?

Change the calculation to text. Wrap your Random calculation with Right ("000000000" & RANDOM , 10)

No matter if it is one digit or two digits, it pads 10 zeros to the front, then gets the 10 right most characters.