Random numbers

She has: 88 posts

Joined: Sep 2001

I have a six-digit random number generator on a form and display it in a text box as a form ID number. My "spread" of numbers is from 000000 - 999999. Is there any way to get all six numbers displayed if the leading numbers are zeros? Right now, all leading zeros are truncated. I guess I could start the spread at 111111 as the life of the number is short.

dk01's picture

He has: 516 posts

Joined: Mar 2002

check the length of the string and then append the appropriate 0's on to the front until the length is 6.
-dk

She has: 88 posts

Joined: Sep 2001

Great! Thanks.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.