How do I remove decimal points from text object?

0 favourites
  • 5 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • 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!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • ScoreB = int(10.7)

  • ScoreB = int(10.7)

    Thanks granpa! Perfect.

  • > 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.

    >

    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

    Thank you! Its always nice to get a bit of extra information along with a helpful answer.

    Very much appreciated.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)