Is there a standard "to left justify text and right justify numeric values."

  • I'm being told by an experienced BA (> 25 years) that "Numeric numbers are usually totaled therefore should be right justified." And that text should always be left justified.

    I have never heard this before now. Is this a true "standard"?

    Numeric numbers as opposed to non-numeric numbers?

    @Charles Boyung - That's another uncertainty for me. E.G. Sometimes a number is actually stored as a string. Medicare codes usually are of the form "####", but they are identifiers. They are not used for mathematical operations. In some cases they may even have an alpha character appended to the end. So is it a number?

    @P.Brian I think you have pretty much identified the difference. A number measures or counts something (such as an age, a price, or similar). Something like a medicare code is not really a number even though it looks a bit like one: it's just a string of characters.

    @P.Brian, identifiers should probably still be right-aligned if the ordering is numeric first (11 comes beforer 100). I am not familiar with medicare codes, but perhaps it should be aligned on the last numeric character.

    what about dates?

    Well, it's in Excel, so many many users end up seeing it. Not sure it's a standard, though. Personally I prefer decimal-aligned numbers.

    I would assume that non-numeric numbers means "twenty-one" etc. Clearly there's no rule to right-justify these.

    Excellent question. It was a bit of an issue at my previous job, where I had bar charts with values (varying from billions to thousands) placed on top of them. So when I aligned values to the right so that it would be legible to user which value is the biggest, I also had to align bars of the chart to the right (otherwise they'd conflict), and that annoyed the management to no end. Tests didn't show that users are affected though. Eventually I think they killed the values and left only bars aligned to left.

  • Yes. English text is usually left-aligned. Numbers are normally aligned so that the various places (unit, tens, etc.) are in columns. If the numbers are integers, this just means right-aligning the numbers. If they have decimal fractions, then the decimal places should be aligned, with the units digits all in a vertical line.

    This makes it easy to compare the numbers' magnitudes. Mac OS X gets this wrong in the Finder: File sizes are given in abbreviated form, such as 342kB or 6MB. When reading a file listing, it's hard to spot the 342MB file amongst all the 342kB files.

    Numbers should always be right justified if they're to be compared, especially for cash amounts; this keeps the decimal in the same place if the items are rounded the same and makes arithmetic and comparison easy.

    @Ben Brocka Numbers should be right-aligned only if their fractional parts are a fixed width (for example, cash amounts probably have a decimal point and 2 fractional digits.). But for example, if your list is 2, 14 and 3½ then the numbers should be aligned on the units digit, *not* right-aligned.

    True, I'm just very used to money being arranged this way, not non-standard decimals/ect, so I hadn't considered

    Why not decimal-align them then?

    @Alex, I did suggest that in my answer. See also my other comment on handling non-decimal fractions.

    I'm interested in this question for dates? And how about parts of a date, for example a year, should this be right-aligned as well?

    @Kim, it looks neater if days line up with days, months with months and years with years. Individually they should probably be right-aligned like numbers. Depends how the dates are formatted. Maybe you should ask this as a separate question.

License under CC-BY-SA with attribution


Content dated before 7/24/2021 11:53 AM