I have successfully generated random numbers using the following AS@ code:
Number1 = Math.ceil(Math.random() * 1000); This works great for generating number 1 - 1000 but only whole number. I would like to generate a number with 2 digits to the right of a decimal place i.e. 13.52. I tried some code in the Adobe help but it doesn't always work because AS2 only displays 2 digits past the decimal but there could be several more digits (i.e. display 13.52 where as the number really is 13.5346). I am working on a Flash program to drill children in math and if I could get this working it would expand the abilities of my program.
Number1 = Math.ceil(Math.random() * 1000); This works great for generating number 1 - 1000 but only whole number. I would like to generate a number with 2 digits to the right of a decimal place i.e. 13.52. I tried some code in the Adobe help but it doesn't always work because AS2 only displays 2 digits past the decimal but there could be several more digits (i.e. display 13.52 where as the number really is 13.5346). I am working on a Flash program to drill children in math and if I could get this working it would expand the abilities of my program.