How do I Add a Decimal Point to a Number

Get help using Construct 2

Post » Tue Jun 03, 2014 8:23 pm

I have a number variable called NumValue. I want to add a decimal point to the end of the number. I've tried the following:

Add "." to NumValue
Set NumValue to NumValue & "." (BTW, this works for numbers)
Set NumValue to NumValue + "."

None of these worked. Any help would be greatly appreciated.
B
9
S
1
Posts: 8
Reputation: 1,043

Post » Tue Jun 03, 2014 8:27 pm

You can't add a decimal point to a "number" type. What are you actually wanting to achieve?
ImageImageImage
B
71
S
22
G
258
Posts: 3,792
Reputation: 143,200

Post » Tue Jun 03, 2014 8:29 pm

I working on a calculator so I need to be able to add a decimal point to the current displayed number.
B
9
S
1
Posts: 8
Reputation: 1,043

Post » Tue Jun 03, 2014 8:33 pm

I think you d be better off having a string representing the number, then translate it to a number when the calcul is needed.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
54
S
22
G
18
Posts: 2,123
Reputation: 17,150


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests