Ignore negative and treat value as positive?

Get help using Construct 2

Post » Thu Jun 02, 2016 1:12 pm

Is there some way, using expressions, of ignoring the fact a number is a negative value, and just treating it as a positive? Sort of like how round() ignores the decimal point, can you tell c2 just consider -50 as 50, -100 as 100, etc?
B
41
S
12
G
14
Posts: 1,120
Reputation: 11,259

Post » Thu Jun 02, 2016 1:15 pm

abs(x) Absolute value of x e.g. abs(-5) = 5
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Thu Jun 02, 2016 1:20 pm

granpa wrote:
abs(x) Absolute value of x e.g. abs(-5) = 5

Thankyou! :oops: I'm not very good with maths... or the manual apparently :D
B
41
S
12
G
14
Posts: 1,120
Reputation: 11,259

Post » Fri Jun 03, 2016 5:32 pm

On the flip side, is there a function to shift a value one decimal point to the right, "4" becomes "0.4"?
B
41
S
12
G
14
Posts: 1,120
Reputation: 11,259

Post » Fri Jun 03, 2016 5:33 pm

Just divide by 10.
B
92
S
32
G
109
Posts: 5,294
Reputation: 70,999

Post » Fri Jun 03, 2016 5:37 pm

R0J0hound wrote:Just divide by 10.

Of course! :oops: Is there a way of making single digits (1-9) become 0.1-0.9, then 10-19 become 0.10-0.19?
B
41
S
12
G
14
Posts: 1,120
Reputation: 11,259

Post » Fri Jun 03, 2016 5:40 pm

Every time you divide by 10 it moves the digits over to the right one. In your second example it happens twice so
90/10/10 or 90/100 = 0.9
B
92
S
32
G
109
Posts: 5,294
Reputation: 70,999

Post » Fri Jun 03, 2016 5:45 pm

http://www.mathsisfun.com/
good site to learn
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Fri Jun 03, 2016 6:05 pm

granpa wrote:http://www.mathsisfun.com/
good site to learn

:?
B
41
S
12
G
14
Posts: 1,120
Reputation: 11,259

Post » Fri Jun 03, 2016 6:58 pm

@Zebbi ,My link was not a jab at you personally so please do not take it as such . As a 40 year educator and opponent on the curriculum now used to teach mathematics , I have used every means at my disposal to teach what USED to be considered basic knowledge . I have recommended this site to PHD's who could not even balance their check book , yet were outstanding Teachers . I meant no offense toward your intellect , this site is full of knowledge and done in a fast and easy way .
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Next

Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 39 guests