on 11-06-2008 9:10 PM
I have the following formula that looks similar to this..
(Field1) - (Field2)
when field 1 is smaller then field 2 we know that the number will be a negative and the report will print a negative sign in front of the number.
Now here is the question, say (Field1) was equal to 10, and (Field2) was equal to 9 the formula would look like
(10) - (9)
and the report would print a positive 1. Is there anyway to format the formula to display a Positive sign in front of the number if it is positive, and a negative in front of the number if it is negative?
Thanks everyone for your help!
Hi Levi
You can modify your formula like this...
numbervar a:=0;
a:=({Field 1})-({Field 2});
if a >= 0 then
"+" & a else "-" & a;
Hope this helps...
Regards
Ankeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, that formula works for me. I had to slightly modify the formula because it was printing two negative signs on ther report instead of one. I think that may have been due to how I had my number formatting options set in Crystal.
Here is the original formula:
numbervar a:=0;
a:=(Field1)-(Field2);
if a >= 0 then
"+" & (a) else " -" & (a);
Then I changed it to be:
numbervar a:=0;
a:=({@JM_ClaimAmt})-({Reconciliation_GetReport;1.UPCClaimAmt});
if a >= 0 then
// Took out the negative sign here so it would not show negative twice.
"+" & (a) else " " & (a);
It works now, I'm happy
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.