Numeric fields
-
- Posts: 1
- Joined: Tue Oct 10, 2017 12:44 pm
Numeric fields
My question is probably too easy. I have a numeric field that I need to have the negative sign print at the end of the field not at the beginning. Can someone please help. Currently my calculated field reads GROSS*100 (to remove an decimal points).____Thanks!!!__Kathy
=> RE: Numeric fields
Place the calc ABS(GROSS*100)on the layout and then right after it place a calc with the expression:__IIF(GROSS<0,^-^,^^)____This will add the trailing minus for negative numbers.____Kathleen__R&R Support
-
- Posts: 49
- Joined: Tue Oct 10, 2017 12:44 pm
=> RE: Numeric fields
I created an additonal calculated field (just to make the syntax easier) called calc1. Calc1 is Gross*100__Then I created a calculated field called prt_calc1__its definition is IIF(calc1<0, str(calc1*(-1))+ "-", str(calc1))__What this does is if calc1 is less than 0, I multiply calc1 by -1 to get rid of the "-" on the front. Then I append the "-" to the back. If the expression is >= 0, I just print the string of calc1.__I had to use the str function in order to add the "-" to the number.__Hope this helps. ______Rick Johnson____Rick Johnson