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.