# Random numbers help please

**URL:** https://forum.kirupa.com/t/random-numbers-help-please/142683
**Category:** Uncategorized
**Created:** [March 30, 2005, 6:57pm UTC](https://forum.kirupa.com/t/random-numbers-help-please/142683 "2005-03-30T18:57:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dragonfly](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dragonfly](https://forum.kirupa.com/u/dragonfly)
#### Post date: [March 30, 2005, 6:57pm UTC](https://forum.kirupa.com/t/random-numbers-help-please/142683/1 "2005-03-30T18:57:13Z")

</div>

Hello.

I want to return a random whole integer between 0 and 4 for a 1:5 ratio of returning one of these numbers.

I currently use Math.round(Math.random()\*4; Since flash will round the result, 0-3 will occur more often because the can be rounded to from a higher or lower number, while 4 can only be rounded up too… Does that make sense?

So, how do i get an even ratio of 1:5?
