I’m trying to format a number so that:
- If it’s an integer, only the integer is displayed
- If there are decimal places, a maximum of two are displayed
- Any trailing zeros in decimal places are not displayed
- The decimal point is only shown when it is required
- Negatives and numbers higher than 10 are not relevant
This image shows what I’ve tried and I go into a bit more detail below that. Please note that the ‘Ideal Solution’ column has been graphically edited from the output shown in the ‘Number’ column.
I looked in the Help and found the section on number formats (file:///usr/share/libreoffice/help/en-GB/text/shared/01/05020301.html).
I applied the format 0.??
as the documentation states:
The ? works as the # but adds a space character to keep decimal alignment if there is a hidden non-significant zero.
As you can see from the image, the decimal alignment only works if you’re using a monospace font. This may be a bug, but I don’t know the software well enough to decide. I tried to fix this by using the underscore character to specify space width, but found that it was for inserting an actual space rather than specifying the width of all spaces in the format.
At this point, I’m assuming that what I want to achieve is not possible, and I’m using the monospace font approach.
So two questions:
- Am I right, and I can’t get the format I’m after?
- Is the decimal alignment using a proportional font a bug I should report?