Align decimal points

Here is an brief excerpt from a column in a Calc spreadsheet. The numbers in the example are meaningless; they serve only to illustrate the problem:

1.7 g per 1/4 cup
25.9 C per 1/4 cup
4 portions per cup

These cells are formatted as follows:

0.0" g per 1/4 cup"
0.0" C per 1/4 cup"
0" portions per cup"

See a screenshot of the CELL FORMATTING and RESULT at

C:\fakepath\Decimal Alignment Example.PNG.

How can I format the cells so the decimal points are aligned?

I understand that I can insert spaces of varying widths immediately after the number by using _m, _i, and so forth, but I am looking for something less klugey.

Any suggestions?

(edit: activated screenshot)

You could do this using ? format code described on this help page:

The ? works as the # but adds a space character to keep decimal alignment if there is a hidden non-significant zero.

You might change your format strings to be:

???0.0" g per 1/4 cup"
???0.0" C per 1/4 cup"
???0" portions per cup"

(I guessed you might use 4 digit numbers, but you can adjust to your needs), align cells to the left, and use a monospace font (like Liberation Mono).

Thanks Mike, That’s just what I was looking for. Shame on me for not using a monospaced font from the get-go!

See also this old Q&A.