change number
#1

How -5555 change to 5555 ?
Reply
#2

be more explicit
Reply
#3

I need to change any number that is negative variable (< 0) to its positive variable (> 0), remove - from variable if it has it.

Damn, example:

new a = -number;
new b;

How to make b = +number ?
Reply
#4

i think it's possible with strdel, just delete the "-" from the number.
Reply
#5

Isn't there some function like:
pawn Код:
new a = -5, b;
b = modulus(a);
and then b automatically = 5
??
Reply
#6

pawn Код:
-5555 * (-1) = 5555
Sixth grade people ?
Reply
#7

I have problems with mathematic, so not everything i can remember and do easily Thx for help
Reply
#8

Well, I think this should work:

pawn Код:
new a = -5, b;

b = a-2*a;
Hope this works. Simple, right?
Reply
#9

Quote:
Originally Posted by Dreftas
I have problems with mathematic, so not everything i can remember and do easily Thx for help
What do you do with this formule?
Reply
#10

I don't know what the hell you're doing with all this a/b nonsense, looks like BODMAS disaster in the making.

All you need to do is check if it's below 0, then either times it by -1, or subtract it from 0.

Eg. you have -5555

-5555 x -1 = 5555

0 - ( - 5555) = 5555
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)