Always "x" digits

Get help using Construct 2

Post » Sun Jan 13, 2013 1:59 pm

I want to have a text counter where there will always be 3digits

So it will be like this:
100
099
098 and so on..

Anyone got an idea and/or example of how to do this?
(\__/)
(='.'=)
(")_(")
B
20
S
9
G
1
Posts: 68
Reputation: 3,057

Post » Sun Jan 13, 2013 2:04 pm

Zeropad is what you need. Format is zeropad(number,digits)
B
56
S
15
G
10
Posts: 910
Reputation: 11,942

Post » Sun Jan 13, 2013 2:07 pm

Thanks for the help!

Could someone maybe create an example?TheNormalGeek2013-01-13 14:31:09
(\__/)
(='.'=)
(")_(")
B
20
S
9
G
1
Posts: 68
Reputation: 3,057

Post » Sun Jan 13, 2013 6:09 pm

When you set your text in event sheet :
myText : Set text to zeropad(myVariable, 3)
B
31
S
9
G
1
Posts: 45
Reputation: 4,492

Post » Mon Jan 14, 2013 1:49 pm

Wow, that's amazing. I'd been making a whole slew of actions to add zeros, didn't know there was a function to do it haha.

Excellent stuff.
Image
B
27
S
9
G
5
Posts: 487
Reputation: 11,939

Post » Mon Jan 14, 2013 4:30 pm

Anyone that might provide a capx?
(\__/)
(='.'=)
(")_(")
B
20
S
9
G
1
Posts: 68
Reputation: 3,057

Post » Mon Jan 14, 2013 8:40 pm

Image
B
27
S
9
G
5
Posts: 487
Reputation: 11,939

Post » Tue Jan 15, 2013 6:41 am

Thank you!
(\__/)
(='.'=)
(")_(")
B
20
S
9
G
1
Posts: 68
Reputation: 3,057

Post » Wed Jan 16, 2013 10:33 am

_Thank you!












____________________________________________________
http://www.mmoggg.de/
B
2
Posts: 3
Reputation: 406


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests