Numeric fields

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Kathy_Knoche_(Guest)
Posts: 1
Joined: Tue Oct 10, 2017 12:44 pm

Numeric fields

Post by Kathy_Knoche_(Guest) » Thu Feb 27, 2003 4:36 pm

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

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Numeric fields

Post by kfleming » Thu Feb 27, 2003 5:36 pm

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

rickwjohnson
Posts: 49
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Numeric fields

Post by rickwjohnson » Thu Feb 27, 2003 5:43 pm

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

Post Reply