Can anyone help me out with this?
I’ve set up 10 text boxes to have a random number placed in them, this number needs to be to one decimal place
I’ve added the below code and it work fine except that when the number is a whole number it doesnt show the .0
eg
9.6
9.7
3.3
9.7
6 <---- needs to be 6.0
9.6
1.5
5 <---- needs to be 5.0
0.7
3.1
textBox = Array(10);
for (i = 0; i <= 9; i ++){
textBox* = random(100);
}
//Assign array values to place on grid
for (i = 0; i <= 9; i ++){
_root["textBox" + i] = textBox*/10;
}
I tried the time old method of decimal places
_root["textBox" + i] = int((textBox*/10)*10)/10;
is there anyway to get it flash to show the .0?
or can someone help me with another way of generating random numbers without selecting whole numbers?
thanks for any help