How to create a 10 digit...

# Thread: How to create a 10 digit...

1. Webminster Guest

## How to create a 10 digit...

How would I create a ten digit Random number?<BR>More like a serial number.<BR><BR>Thanks for the help

2. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## RE: How to create a 10 digit...

Well the easiest way i can think of is generate random numbers from 0-9 10 times

3. Senior Member
Join Date
Dec 1969
Posts
1,944

## Na..Na..Na

&#062;&#062;Well the easiest way i can think of is generate random numbers from 0-9 10 times<BR><BR>WANT TO RUN 10 TIMES TO GET ONE NUMBER.<BR><BR>BUT,the easiest way i can think of is generate random numbers from 1000000000-9999999999 ONE TIME FOR EVERY NUMBER.<BR>

4. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## Well thst is true

what i was thinking is this way the chances of having the SAME number is cut down a lot more since we know that ramdomize will not generate a diff number every time<BR><BR>but i guess thinking about it your will be the better way<BR>

5. Steve Cimino Guest

## Only one problem

Since rnd returns a number between 0 and 1, we typically use the Int() function to pull the whole number out of there (so we have a number between 1 and 10 say). Now the first value will work if we just do a CLng() on it, but your final number - 9,999,999,999 - will cause an overflow on a long.<BR><BR>I guess you could convert the thing to a string, and then truncate everything past the decimal point if you did a CDbl on it?<BR><BR>What do you think?

6. Senior Member
Join Date
Dec 1969
Posts
1,944

## RE: Only one problem

Yeah!but i really din&#039;t went into that much deeper.They are all going to be part of my permutation and combinations while arriving at the right result.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•