Subtract value wrong sign results

I hav a small app.
3 Textboxes ‘less’ ‘add’ ‘balance’
1 button ‘start’
In blocks… Bal gets valu of Add minus Less. When Add is 100 and Less is 50, I getd 50 in Bal.
But when When Add is -100 and Less is 50, I getd 150 in Bal. I must get -150. Plese help.

You need to know basic of maths
+ + Is +
- + is -
+ - is -
And - - is +
So solution is you need to know that is any number contains - then you have to - not +
Eg.
-6 -1 = -7
And again you have to check that bigger number sign is positive or negative if negative then your answer sign is negative after adding

1 Like

Some math I knoe. :slight_smile:
My ‘less’ is always minus. My ‘add’ maybe plus our minus. Here is problems. But My ‘bal’ must show corekt sign +/-. How I can do? I will post pictur of bloc tomoro if it help.

You have to check before performing any operation that bal is negative or positive

If the value is negative, the negative sign will come up. So the problem is on your blocks and basic math

OK. Som kind of ‘if’ add’ is <0 then… Ty vm. I’ll try. Gn

I agree with @WatermelonIce, simple math

2 Likes

kodbal

i sa my mistek. i chnanged minus to plus. very sily mistk. now it is corect. ty all. ty for baring me.

1 Like

Then mark my this post as solution

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.