# Decimal Place Question

**URL:** <https://forum.kirupa.com/t/decimal-place-question/239335>\
**Category:** flash\
**Created:** [September 20, 2007, 4:44pm UTC](https://forum.kirupa.com/t/decimal-place-question/239335 "2007-09-20T16:44:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![540media](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/540media/32/2543_2.png) [@540media](https://forum.kirupa.com/u/540media)\
**Post date:** [September 20, 2007, 4:44pm UTC](https://forum.kirupa.com/t/decimal-place-question/239335/1 "2007-09-20T16:44:48Z")

</div>

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

```auto

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

```auto
_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
