I'm printing out huge tables of numbers aligned to the centre of each cell.
This looks fine except when negative numbers start to appear.
The align to centre then doesn't look quite right as the negative sign casues a bit of offset.

The way around this is to align to the decimal point by putting a decimal tab in the middle of the cell and aligning left to it.

However, I am currently only doing this by eye.
How can I work out programatically where to put the decimal tab, based on the length of the number?

The numbers will all have the same number of decimal places in each column but can have different number of places in different columns/tables.