Floating Minus Signs

RPG
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

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 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: