Bug 96815 - HELP: '?' inserts whitespace in number format
Summary: HELP: '?' inserts whitespace in number format
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-29 21:35 UTC by Johannes Pfrang [:johnp]
Modified: 2020-01-03 09:19 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Pfrang [:johnp] 2015-12-29 21:35:47 UTC
Using LibreOffice Calc 5.1.0.1 (x64) creating a field with the following formats and entering an integer / whole number leads to whitespace being appended to the given number.

Example custom number formats:

"# ?/?"  -  Always adds additional whitespace for each added question mark; maybe intentional but not clear from the documentation
"# #/#"  -  Undocumented; does not add additional whitespace but also seems to not remove the whitespace before the optional fraction, leading to a non-removable trailing whitespace leftover (this seems to happen in the first case too)
Comment 1 raal 2016-01-02 09:20:37 UTC
"# ?/?" - reproducible with LibreOffice 3.5.0 Build ID: d6cde02, lowering version

Version: 5.2.0.0.alpha0+
Build ID: a27fac3b8f2bae18f62bab315051732df1bb29ab
CPU Threads: 4; OS Version: Linux 4.2; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-01-01_05:08:26
Comment 2 Laurent Balland 2016-05-02 20:21:24 UTC
It is an undocumented feature.

This Help page should be improved:
https://help.libreoffice.org/Common/Number_Format_Codes#Decimal_Places_and_Significant_Digits
Comment 3 Johannes Pfrang [:johnp] 2016-05-02 20:28:39 UTC
I agree with the first one ('# ?/?') setting the length of the dividend/divisor to a fixed value being an undocumented feature, but the single non-removable whitespace between the integer and the fraction part is a bug to me.

Put 0.5 in a cell and format it as '# #/#'. The 1/2 will have a leading whitespace in front of it, because the integer zero gets omitted, while the whitespace stays.
Comment 4 Laurent Balland 2016-05-02 21:24:47 UTC
(In reply to Johannes Pfrang [:johnp] from comment #3)
> Put 0.5 in a cell and format it as '# #/#'. The 1/2 will have a leading
> whitespace in front of it, because the integer zero gets omitted, while the
> whitespace stays.

Your example is not good because whitespace is unconditionally defined in the format, so it has to be displayed.
There is no whitespace with format
[<=-1]# #/#;[>=1]# #/#;#/#
Comment 5 Laurent Balland 2016-05-03 06:22:17 UTC
Local help has been updated:
https://gerrit.libreoffice.org/#/c/21827/

but online help is not up to date.
https://help.libreoffice.org/Common/Number_Format_Codes#Decimal_Places_and_Significant_Digits
Comment 6 sdc.blanco 2020-01-03 08:55:13 UTC
(In reply to Laurent BP from comment #5)

> but online help is not up to date.

The gerrit page is online now.  

https://help.libreoffice.org/latest/en-US/text/shared/01/05020301.html?&DbPAR=CALC

Maybe this is resolved now?  Or do you think something else is still missing?
Comment 7 Laurent Balland 2020-01-03 09:19:23 UTC
(In reply to sdc.blanco from comment #6)
> Maybe this is resolved now?  Or do you think something else is still missing?

You are right. Resolved as Fixed.