Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
How the heck do you get a credit balance to show in parentheses? I got this to work -
'0( . 0)'
But then I lost zero suppression, and I can't get it back. Now a credit balance of $500.00 shows as (00500.00).
I'm tending more towards using character fields for output (both display and printer), then use %editc in program to perform the dec->char conversion. This makes it easy to add fancy stuff like parentheses to negative displays.
Like Neil hinted, you edit codes and edit words don't support what you're trying to do. Use an appropriate edit code or edit word on your numeric, then if it was negative, add the parentheses afterwards.
Thanks - there's so many ways to skin a cat in this language I can't keep track of 'em all.
I write a lot of numeric edit functions. My most recent was a procedure to take DimensionX (9p4), DimensionY (9p4, optional) and UnitOfMeasure (2a). The character output is totally stripped numerics and something like: 30 X 36 IN, or 42.5 IN. %editc is a rocking little built in function.