How do I add fractions to an array?

Get help using Construct 2

Post » Sat Jun 28, 2014 3:29 pm

Hi Guys, so i can enter numbers into an array, and then complete some mathematics on these numbers to get a fraction or irrational number, but how do i actually enter a fractional number into an array?

For example, if i try to insert 10.5 into an array and then display it, the value becomes 10; can i get it to 'save' 10.5?
B
8
Posts: 8
Reputation: 578

Post » Sat Jun 28, 2014 3:43 pm

Looks like my issue is actually with instance variables, can these contain non whole numbers?
B
8
Posts: 8
Reputation: 578

Post » Sat Jun 28, 2014 3:59 pm

Yes. You must be doing something wrong. File-upload is broken today, or I'd attach a sample.
ImageImageImage
B
71
S
22
G
249
Posts: 3,762
Reputation: 138,575

Post » Sat Jun 28, 2014 4:26 pm

Thanks for the reply, do you mean you can insert factions or decimals to an instance variable?
B
8
Posts: 8
Reputation: 578

Post » Sat Jun 28, 2014 5:22 pm

I've gotten so used to the Upload feature I forgot I can just add a link :shock:

http://blackhornettechnologies.com/Cons ... mbers.capx
ImageImageImage
B
71
S
22
G
249
Posts: 3,762
Reputation: 138,575

Post » Sat Jun 28, 2014 5:47 pm

I Think i've solved my issues, i have been using an INT command to pull a number from a text box, i believe i should be using the float command?
B
8
Posts: 8
Reputation: 578

Post » Sat Jun 28, 2014 8:15 pm

Yes.
ImageImageImage
B
71
S
22
G
249
Posts: 3,762
Reputation: 138,575


Return to How do I....?

Who is online

Users browsing this forum: irina, Klarner and 27 guests