vscode-table-formatter icon indicating copy to clipboard operation
vscode-table-formatter copied to clipboard

[proposal] Right align of numeric columns

Open lechu445 opened this issue 8 years ago • 2 comments

For normal tables, columns with all numeric cells would be formatted with right align. EXAMPLE: before formatting:

| column1 | column2 |
|---------|---------|
| text1   | 12.00   |
| text2   |         |
| text3   | 9       |

after formatting:

| column1 | column2 |
|---------|---------|
| text1   |   12.00 |
| text2   |         |
| text3   |       9 |

I think this change refers to method getCellInfoList in helper.ts

lechu445 avatar Aug 11 '17 20:08 lechu445

OK. It looks nice. I will think about it.

shuGH avatar Aug 13 '17 03:08 shuGH

It would be nice to right align by numbers by .:

| column1 | column2 |
|---------|---------|
| text1   |   12.02 |
| text2   |    1.1  |
| text3   |     .01 |
| text4   |         |
| text5   |       9 |

This would make comparing floats with different precision easier. I think intgers should only be right aligned, but aligning by . would be possible too:

| column1 | column2 |
|---------|---------|
| text1   |   12.02 |
| text2   |    1.1  |
| text3   |     .01 |
| text4   |         |
| text5   |    9    |

ChristianKurz avatar Feb 20 '18 09:02 ChristianKurz