making negative numbers positive

wilkob

Registered User.
Local time
Today, 05:47
Joined
Jan 10, 2005
Messages
86
I have a query where I have some negative numbers (f.e. -403,26) which I like to make a positive (i.e. 403,26).

How do I do this??
 
Hi -

Look up the Abs() function. Example:

x = -403.26
? x
-403.26
? abs(x)
403.26

HTH - Bob
 
Multiply by -1

-403,26 * -1 = 403,26
[NameOfTheControl]*-1=

to change 403,26 to a negative number do the same.
 
Last edited:
Hi -

Multiplying by -1 does the trick for sure, if you can always be assured that the original amount will be a negative number. But, what if the amount could be either positive or negative? Multiplying a positive amount by -1 returns a negative balance.

The Abs() function ensures that a positive balance is always returned. Guess it all depends on the particular situation.

Bob
 

Users who are viewing this thread

Back
Top Bottom