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
Hi everyone,
In this scenario I have two scores, (ScoreA and ScoreB) where ScoreB is simply a factor of the ScoreA (say ScoreA divided by 10). Of course though this means ScoreB ends up being numbers like 1.1. How do I make it so that ScoreB is ONLY whole numbers?
For Example:
ScoreA = 107
divided by 10
ScoreB = 10.7
How can I make it so scoreB only shows 10 (omitting or removing the .7).
Thanks!
ScoreB = int(10.7)
Thanks granpa! Perfect.
Develop games in your browser. Powerful, performant & highly capable.
> ScoreB = int(10.7) > Thanks granpa! Perfect.
> ScoreB = int(10.7)
>
You might also want to lookup Ceil , Round , and Floor
ceil(x) Round up x e.g. ceil(5.1) = 6
floor(x) Round down x e.g. floor(5.9) = 5
round(x) Round x to the nearest whole number e.g. round(5.6) = 6
> > > ScoreB = int(10.7) > > > > Thanks granpa! Perfect. > You might also want to lookup Ceil , Round , and Floor ceil(x) Round up x e.g. ceil(5.1) = 6 floor(x) Round down x e.g. floor(5.9) = 5 round(x) Round x to the nearest whole number e.g. round(5.6) = 6
> > ScoreB = int(10.7)
> >
> Thanks granpa! Perfect.
Thank you! Its always nice to get a bit of extra information along with a helpful answer.
Very much appreciated.