Floating Minus Signs
Although there wasn't much fanfare upon its introduction a couple of years ago (in V1R3 of OS/400), IBM finally did provide something that users have wanted for years: the ability to show a negative number with the minus sign on the left. I'm amazed at how many programmers still don't know how to edit numbers with the minus sign on the left.
V1R3 of OS/400 introduced new edit codes N, O, P and Q. They work exactly the same as edit codes J, K, L and M except that negative numbers appear with a floating minus sign on the left rather than on the right. See 8 for examples.
V1R3 of OS/400 introduced new edit codes N, O, P and Q. They work exactly the same as edit codes J, K, L and M except that negative numbers appear with a floating minus sign on the left rather than on the right. See Figure 8 for examples.
Edit codes are always preferable to edit words because edit codes will continue to work if a numeric field size changes. An edit word must be changed when the numeric field it is editing has changed. Still, edit words are self-explanatory and there may be times when you have unusual editing needs. Unfortunately, an edit word cannot be constructed to place the minus sign to the left of a negative number.
Before you go out and change the editing in hundreds of programs, beware that I have encountered complaints from users who actually prefer the minus sign on the right side of the number. Their reasoning was that when scanning a list, it was easier to spot the negative numbers with the minus sign in a fixed position on the right-hand side. So maybe IBM was on to something after all!
Floating Minus Signs
Figure 8 Edit Code Examples
Zero Example Example Edit Balances Negative Zero Code Commas To Print Balance Balance N YES YES -1,025.75 .00 O YES NO -1,025.75 P NO YES -1025.75 .00 Q NO NO -1025.75
LATEST COMMENTS
MC Press Online