# No Decimals in Random

## Recommended Posts

I need a solid number, and when ever i use a random, it some up with like 9 digits after the decimal, how do i stop this, can i put some flag on it???

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

##### Share on other sites

and also, how can you clear an already written registry?...

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

##### Share on other sites
• Moderators

I need a solid number, and when ever i use a random, it some up with like 9 digits after the decimal, how do i stop this, can i put some flag on it???

Hmmm... "some kind of flag on it"

Random(1, 10, iFlag) ?

Random(1, 10, 1)?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

##### Share on other sites

There are 2 ways to do the random number:

```\$nRand = Random(0, 10, 1) ;picks a number 0 - 10
\$nRandom = Random(0, 10) ;picks a number 0.0 - 10.0```

for the registry:

look in the help file under:

RegDelete()

RegWrite()

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...