4 Replies Latest reply on Nov 9, 2009 10:26 AM by maloney

Is there a way to display one digit numbers as two digits?

Title

Is there a way to display one digit numbers as two digits?

Post

Hi everybody,

Is there a way to display one digit numbers as two digits?

Like: 3 as 03

thanks

• 1. Re: Is there a way to display one digit numbers as two digits?

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.

• 2. Re: Is there a way to display one digit numbers as two digits?

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.

• 3. Re: Is there a way to display one digit numbers as two digits?

I've used the Right function like Rick did for years. Recently, Comment pointed out another function that works for this:

SerialIncrement("000";YourNumberfield)

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.

• 4. Re: Is there a way to display one digit numbers as two digits?

Thanks guys,

I've used the case function:

Case (Number < 10 ; "0"  &  Number ; Number)