Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
Hey!
Is it possible to check if a variable contains digits? If so; how can I do that? <img src="smileys/smiley1.gif" border="0" align="middle" /> I'd like to create a event like this;
IF value contains digits
Set text"You won cake!"
Thanks,
~ Thijs
Develop games in your browser. Powerful, performant & highly capable.
int(value) if its not just a number it should return 0 or some form of invalid I believe. Dont hold me to that tho lol
int(x) - convert x to integer
It doesn't check if it is or not and return a 1 or 2..
How about checking if int(x) = x, if it is, then it is an integer already.
int(x) - convert x to integer It doesn't check if it is or not and return a 1 or 2.. How about checking if int(x) = x, if it is, then it is an integer already.
That did the trick! Thanks for the replies! <img src="smileys/smiley36.gif" border="0" align="middle" />