I have a grid with columns that are formatted as cents and dollars. By default, the tender and amount columns are being formatted as integers, but for the total we are formatting it as 2 decimal places (.00).

tender   qty   amt

$5       1   5
$10      1   10
$100     1   100
5¢       1   5
10¢      1   10

total    5  115.15

What is the correct way to format the cents and dollars in the amount column?

  • The Tenders and amt are right aligned in actual grid... but not shown here Commented Feb 26, 2014 at 10:05

3 Answers 3


Consistency is key here I think.
So, for currency, always use two decimals and align every number to the right.

It took me some time to make sense of the table you displayed in your post. I would go for something like this:

tender    qty    amt

  5.00      1      5.00
 10.00      1     10.00
100.00      1    100.00
  0.05      1      0.05
  0.10      1      0.10

total       5    115.15
  • 4
    You also want to align your headers the same way as the rest of the columns they're in, so the eye can scan down them cleanly. Usually, your first column is left aligned, and all other columns and headers are right aligned, to distinguish the lookup column from the data columns. This book covers this sort of table formatting in great detail
    – Racheet
    Commented Feb 26, 2014 at 12:39
  • 1
    Two decimals is correct for USD and many others but wrong for some currencies
    – mmmmmm
    Commented Feb 26, 2014 at 18:45
  • Also, it would be good to keep the $ (or ¥ or whatever) off to the side, to make it totally obvious what the number represents, rather than drop it completely
    – Izkata
    Commented Feb 26, 2014 at 22:50

I would suggest keeping the amount in dollars at all times. Cent values can be shown as decimal dollar values.

Also, you can always have tender and amt columns to show values right-aligned and up to 2 decimal places. This will make values more presentable and less confusing.

  • I disagree, if the user is using the table to work out which physical coins useed in a transaction, which seems to be the intended purpose, then you want the lookup column to have the denominations of the coins/notes, not to be a dollar value for cent coins.
    – Racheet
    Commented Feb 28, 2014 at 14:25

If you're going to display this in a UI, consider alternating the row background colors - between white and a faint/light color of your choice for easier reading.

You can choose to also style your headers row and totals row, but make sure they're readable.

In order to ensure proper right-alignment, use a mono-spaced font. The slightest misalignment of that decimal point is bothersome to many, which will happen if you use a font that has varying character widths.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.