How do I make text display an non-exact value?

Get help using Construct 2

Post » Sat Oct 15, 2016 4:41 am

I realize this might have everything to do with rounding (I never could) but when a text object displays a value, how would I make it display (for example) 5 instead of 5.3 . I do assume it involves rounding, but not at all sure what I'd need to do here.
Oh, okay.
B
23
S
5
Posts: 40
Reputation: 1,253

Post » Sat Oct 15, 2016 7:14 am

Essentially, you have to put any of the system's rounding expressions that suits your needs in front of your value.
Depending on your needs concerning the rounding, you would use one of the following:

1) Rounds up
Code: Select all
ceil(value)

2) Rounds down
Code: Select all
floor(value)

3) Rounds following mathematics rules
Code: Select all
round(value)


Also refer to the manual, system expressions, math section.
https://www.scirra.com/manual/126/system-expressions
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091


Return to How do I....?

Who is online

Users browsing this forum: Blendi1223, gskunk, richcoz81, tarek2 and 39 guests