Bug 100834 - Fraction number format: String " " and other not recognized as blank delimiter
Summary: Fraction number format: String " " and other not recognized as blank delimiter
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Laurent BP
QA Contact:
URL:
Whiteboard: target:5.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-10 10:58 UTC by Laurent BP
Modified: 2016-08-17 13:37 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example of fraction representation in Excel (10.15 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-07-10 10:58 UTC, Laurent BP
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent BP 2016-07-10 10:58:08 UTC
Created attachment 126148 [details]
Example of fraction representation in Excel

Desciption: When Excel is using " " as blank separator between integer and fraction, LibO does not recognize strings as separator and treats them in a very strange manner: string is inserted inside the number representation.

Steps to reproduce:
1. In Excel (French UI), choose a fraction format or define a user format such as:
#" plus fraction "?/???
2. Enter a value: PI() for instance. Value is displayed as:
       3 plus fraction 16/113
4. Save as XLSX
5. Open file in LibreOffice (See attached file)

Actual behavior:
Cell is displayed as
       35 plus fraction 5/113
because LibreOffice interprets format as ##?/??? (which should be 355/113) with string " plus fraction " inserted between 35 and 5

Expected behavior:
LibreOffice should display as in Excel:
3 plus fraction 16/113

In my Excel 2010, French localization, for default display of fraction, Excel inserts the blank between integer and fraction as " " and not as \_ (escape char followed by a space), which is the way that LibreOffice expects Excel would do. For instance, for PI() value and format
#" "?/?
LibreOffice displays
2 2/7
Which seems wrong when compared to expected display
3 1/7
Comment 1 Commit Notification 2016-07-15 20:00:10 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "master":

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

tdf#100834 Treat string between integer and fraction as delimiter

It will be available in 5.3.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 2 Eike Rathke 2016-07-15 20:01:14 UTC
Save/reload in ODF require extension of ODF.
Comment 3 Laurent BP 2016-07-15 20:28:33 UTC
Delimiter string should be inserted only if both integer and fraction are present: format 
#" plus "#/#
Should give representations for 14 and 0.123:
14
and 
1/8
and not
14 plus 
and 
 plus 1/8

New commit on the way to fix it.
Comment 4 Commit Notification 2016-07-22 10:39:18 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3363539e425d5d8f75d976ca2261c07086d6d06a

tdf#100834 String between integer and fraction

It will be available in 5.3.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 2016-07-27 13:14:04 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "master":

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

tdf#100834 Extend ODF for integer/fraction delimiter

It will be available in 5.3.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.