Operators - to + (1 Viewer)

XaloRichie

Registered User.
Local time
Today, 18:14
Joined
Jul 2, 2003
Messages
70
I have a form with two figures a.(Deposit) and b.(Actual charge)
To discover if the deposit was sufficient I take the actual charge (b)from the deposit (a)
When the deposit is less than the charge the Result is a minus.

eg
deposit 100
Less
Charge 150

= -50

I want to use that result to say ask the customer for another 50.00 but without it showing the minus operator.

Anyone know how?

P.S. It could be the other way and then a refund is suggested!
 

Len Boorman

Back in gainfull employme
Local time
Today, 17:14
Joined
Mar 23, 2000
Messages
1,930
If you take the result and multiply by -1 you would remove the minus and all posistive values would indicate a charge whereas a minus would mean a refund

You could always use the original value to indicate Refund or Charge

Depends on how you actually intend to use/display result

Len B
 

XaloRichie

Registered User.
Local time
Today, 18:14
Joined
Jul 2, 2003
Messages
70
operators

Yes great i'll try that.
I had forgotten those possibilities from school. :) Thanks
 

Mile-O

Back once again...
Local time
Today, 17:14
Joined
Dec 10, 2002
Messages
11,316
There's also the Sgn() function which returns one of three values: greater than, equal to, or less than zero, (1, 0, and -1 respectively.)
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:14
Joined
Feb 19, 2002
Messages
43,572
Absolute value

You want the absolute value of the number.

Abs(YourNum) will return 50 whether the value of YourNum was 50 or -50.
 
R

Rich

Guest
Why not just use the Format property of the control to display
50pts or (50pts) as the case may be
 

Users who are viewing this thread

Top Bottom