View previous topic :: View next topic |
Author |
Message |
vak255 Intermediate
Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Mon Jun 27, 2016 11:16 am Post subject: +-$ in the same field without spaces |
|
|
I have a discount field which has sign and $.
This is defined as DISCOUNT PIC +$$$9.9(2)
so this is display as below.
Code: |
DISCOUNT
DETAILS
--------
- $0.95
- $2.00
+ $0.00
- $0.95
--------
|
I don't want space between the sign and $.
How should I define it? thanks for your time. |
|
Back to top |
|
|
vak255 Intermediate
Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Mon Jun 27, 2016 11:20 am Post subject: |
|
|
I think I will use +$999.9(2), if I could not compress leading zeros. |
|
Back to top |
|
|
William Collins Supermod
Joined: 03 Jun 2012 Posts: 437 Topics: 0
|
Posted: Mon Jun 27, 2016 12:12 pm Post subject: |
|
|
Use the currency-symbol as the "floating zero-suppress" and put the sign to the right of the output. You can't have two floating editing symbols operating at the same time. |
|
Back to top |
|
|
vak255 Intermediate
Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Mon Jun 27, 2016 1:15 pm Post subject: |
|
|
Thanks, will use the below.
$$$$9.9(2)- |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Mon Jun 27, 2016 1:45 pm Post subject: |
|
|
vak255,
Alternatively you can use an INSPECT to replace the space and adjust the sign.
Code: |
DISCOUNT PIC +$$$9.9(2).
INSPECT DISCOUNT REPLACING ALL '+ $' BY ' +$'
'- $' BY ' -$'
'+ $' BY ' +$'
'- $' BY ' -$'
'+ $' BY ' +$'
'- $' BY ' -$'
|
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
William Collins Supermod
Joined: 03 Jun 2012 Posts: 437 Topics: 0
|
Posted: Tue Jun 28, 2016 12:52 am Post subject: |
|
|
FIRST could replace the ALL, and save a bit. Even LEADING, although that would look at at least one extra byte. Can even drop the $. Various ways with INSPECT.
The thing is, anyone who is interested in whether a value is positive or negative is not interested in "bouncing" their eyes around to locate a floating symbol. Two columns, CR/DB, right=most signs. Then either it already stands out (columns) or you can rapidly scan page after page looking for those odd negative values. Try it |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Tue Jun 28, 2016 10:38 am Post subject: |
|
|
William Collins wrote: | FIRST could replace the ALL, and save a bit. Even LEADING, although that would look at at least one extra byte. Can even drop the $. Various ways with INSPECT. |
William,
I should have used FIRST instead of ALL. I just picked one of my existing examples and just changed the input and output strings.
My Apologies. _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Tue Jun 28, 2016 12:39 pm Post subject: |
|
|
As William says, most people I've encountered prefer the trailing negative sign as they are more easily spotted. _________________ ....Terry |
|
Back to top |
|
|
|
|