Random number

1. Bob
Senior Member
Join Date
Dec 1969
Posts
778

## Random number

How can I display a random number between 1 and 20

2. <eop> Guest

## RTFM

.

3. Senior Member
Join Date
Dec 1969
Posts
667

## RE: Random number

INT( ( RND() * 10 ) + 1 )<BR><BR>this give a random number between 1 and 10.<BR><BR>i&#039;m sure you could get it to 1 and 20 with some math

4. Senior Member
Join Date
Dec 1969
Posts
1,432

## Dude calm down ....

Yeah .... I agree .... basic question and can be found out by reading the docs ... but I know I have asked some stupid questions.<BR><BR>Anyway, to expand on my friend&#039;s answer ..... look for it on some online docs. And also I would HIGHLY recommend buying a book. This one is great.<BR>http://www.wrox.com/Books/Book_Details.asp?sub_section=11_3&isbn=1861003382& subject=ASP&subject_id=28<BR>It will answer a LOT of your questions.

5. Senior Member
Join Date
Dec 1969
Posts
898

## The math

The Math<BR><BR>For a random number between any two numbers a & b do<BR><BR>(b-a)*Rnd() + a<BR><BR>for random integers between a & b do<BR><BR>int((b-a)*rnd()+a)+.5) Notice I&#039;m rounding not rounding down, this will give you a better distribution of results.

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

## What is RTFM?

nt

7. Senior Member
Join Date
Dec 1969
Posts
11,334

## RE: What is RTFM?

;)<BR><BR>http://210.10.49.75/Q209354.asp

8. Senior Member
Join Date
Dec 1969
Posts
1,432

## What is nt? <eop>

.

9. Senior Member
Join Date
Dec 1969
Posts
1,671

## NT stands for No Text.

nt... but I guess if I wrote nt, that would mean there&#039;s text, huh? Ack!

10. Senior Member
Join Date
Dec 1969
Posts
1,129

## Mybe you need to use VLT....

For Very Little Text....Or NTTPTTT, for No Text That Pertains To The Thread. &#060;/grin&#062;

#### Posting Permissions

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