# How do I minus x percent ?

Get help using Construct 2

### » Tue Oct 06, 2015 10:50 am

I have few variables var1 var2 var3 and var4 so
var1 is 33, var2 is 25
var3 shows me (var1+var2)

i set in event sheet var1 plus var2 so text object(var3 included) show me 58

but var4 is for percentage discount so when i type 5 to var4, var3 should me show 58 - 5 percent.

how make that expression ?
Last edited by delgado on Tue Oct 06, 2015 10:54 am, edited 1 time in total.
B
118
S
32
G
50
Posts: 1,889
Reputation: 38,034

### » Tue Oct 06, 2015 10:54 am

(var3/100)*(100-var4)
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

### » Tue Oct 06, 2015 11:30 am

@LittleStain Yay thank you
B
118
S
32
G
50
Posts: 1,889
Reputation: 38,034

### » Tue Oct 06, 2015 2:24 pm

@LittleStain i have one problem.

Take look at https://dl.dropboxusercontent.com/u/447 ... index.html

and
B
118
S
32
G
50
Posts: 1,889
Reputation: 38,034

### » Tue Oct 06, 2015 2:40 pm

Sorry, but I don't understand the language and as such am not sure what should happen where..

But I guess setting the text to : round((var3/100)*(100-var4)) should do the trick..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

### » Tue Oct 06, 2015 2:46 pm

@LittleStain if i add round to Your expression ammount skip by 100, 200, 300, 400, 500
But this should be like in attached image '440' but not '440.000000006"

Any ideas?
B
118
S
32
G
50
Posts: 1,889
Reputation: 38,034

### » Tue Oct 06, 2015 2:54 pm

Not sure why that would happen (Maybe I'm missing something)
Did you put round around the whole expression or just the first part?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

### » Tue Oct 06, 2015 3:07 pm

@LittleStain maybe i shhare with my capx
Last edited by delgado on Tue Oct 06, 2015 4:37 pm, edited 1 time in total.
B
118
S
32
G
50
Posts: 1,889
Reputation: 38,034

### » Tue Oct 06, 2015 3:10 pm

I set text to : round((cenakoncowa/100)*(100-RABAT))&"zł"

And everything works as expected..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

### » Tue Oct 06, 2015 4:36 pm

You add "((" and "))" 😉
B
118
S
32
G
50
Posts: 1,889
Reputation: 38,034

Next