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
57
S
15
G
11
Posts: 912
Reputation: 12,581

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
34
S
9
G
1
Posts: 46
Reputation: 4,610

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: 488
Reputation: 11,948

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: 488
Reputation: 11,948

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: Kyatric, oddreal, oosyrag, waguilar and 2 guests