A few ways, BUT I like to create a second field and do something like this:
If ( XXX < 10 ; 0 "")
then add a final field to combine the two together:
field one & field two
Your result will be a 2 digit number.
Other ways to do this, but often I have more logic involved to fix credit card expiration dates to be formatted properly.
Right( "000000000" & number; digits)
In the particular case you describe enter "2" for digits. Keep in mind that should your number be greater than 99 and "digits" is set to "2" you'll start getting 00,01,02 etc.
I've used the Right function like Rick did for years. Recently, Comment pointed out another function that works for this:
will format with leading zeroes as well.
For simply formatting the number, I don't see any real advantages/disadvantages between the two functions. However, SerialIncrement has other features that may make it more advantageous when you are also performing math operations on your value.
I've used the case function:
Case (Number < 10 ; "0" & Number ; Number)