Bug 117575 - Number formats: Thousands separator should be space if not preceded by a digit.
Summary: Number formats: Thousands separator should be space if not preceded by a digit.
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Laurent Balland
URL:
Whiteboard: target:6.2.0 target:6.1.0.1
Keywords:
Depends on:
Blocks: Number-Format
  Show dependency treegraph
 
Reported: 2018-05-12 06:56 UTC by Jim Avera
Modified: 2018-07-02 01:59 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Demo spreadsheet "formatdemo.ods" (11.10 KB, application/vnd.oasis.opendocument.spreadsheet)
2018-05-12 06:58 UTC, Jim Avera
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Avera 2018-05-12 06:56:40 UTC
Description:
In a number format, "(?)works as the (#) but adds a space character to keep decimal alignment if there is a hidden non-significant zero." [from the help text].

However (?) does not play well with thousands separators:

With a fixed-width font such as Courier, using a format like "????????0.00"
will nicely display all values below 1 Billion with decimal points aligned.

However with number format "???,???,??0.00" the decimals are aligned but smaller values have extra commas hanging out in space to the left.

Please see attached demo file.

SUGGESTED SOLUTION: Make thousands separators (e.g. comma in the United States) format as a space when there is no actual digit to the immediate left.  This will make it work nicely with "?", which already formats as a space when there is nothing significant to show.


Steps to Reproduce:
1. Open attached "formatdemo.ods" file


Actual Results:  
Extraneous commas are shown for smaller values using format code "???,???,??0.00".

Expected Results:
Would like the non-significant commas to become spaces.


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0
Comment 1 Jim Avera 2018-05-12 06:58:08 UTC
Created attachment 142042 [details]
Demo spreadsheet "formatdemo.ods"
Comment 2 Buovjaga 2018-06-14 16:25:33 UTC
Yep.

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: 8447d31e529985ef7fc71933f0e55685530f9fc9
CPU threads: 8; OS: Linux 4.16; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group threaded
Built on June 14th 2018

Arch Linux 64-bit
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 3 Laurent Balland 2018-06-16 08:40:43 UTC
(In reply to Jim Avera from comment #0)
> Description:
> In a number format, "(?)works as the (#) but adds a space character to keep
> decimal alignment if there is a hidden non-significant zero." [from the help
> text].
> 
> However (?) does not play well with thousands separators:
Careful: (?) in integer part are not (yet) correctly saved in ODF. You need to save in Excel format to keep it.

Correct treatment of thousand separators with (?) is proposed here: 
https://gerrit.libreoffice.org/55901/
Comment 4 Commit Notification 2018-06-19 22:40:39 UTC
Laurent BP committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=062e0999c2b7923e463f1611204a63f0bb7b6404

tdf#117575 treat thousand sep with ? in integer part

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2018-06-20 18:39:39 UTC
Laurent BP committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4fd46c905f1bd45bd55e25fcf3d472c5bf8e5ded

tdf#117575 Add QA unit test of thousand sep

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2018-06-20 22:49:01 UTC
Laurent BP committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=57eec349eeb0cf7d0acdeff09daed5867385db4d&h=libreoffice-6-1

tdf#117575 treat thousand sep with ? in integer part

It will be available in 6.1.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Laurent Balland 2018-06-21 21:03:16 UTC
Please create a new bug report to enhance ODF to keep this format.
Comment 8 Jim Avera 2018-06-22 16:04:57 UTC
> Please create a new bug report to enhance ODF to keep this format.

Done.  

https://bugs.documentfoundation.org/show_bug.cgi?id=118324
Comment 9 Jim Avera 2018-06-22 17:28:31 UTC
Confirming fix WFM(using .xlsx) on latest master.  Thanks!