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: VERIFIED 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 Balland
URL:
Whiteboard: target:5.3.0 target:7.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-10 10:58 UTC by Laurent Balland
Modified: 2021-08-13 12:45 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 Balland
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Balland 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 Balland 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.
Comment 6 Commit Notification 2021-05-24 19:29:51 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/811c9ca5747c8144ffa4ff327d0e4238f4197033

tdf#100834: svl_qa_cppunit: Add unittest

It will be available in 7.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 7 Stéphane Guillou (stragu) 2021-08-13 12:45:13 UTC
Verified as fixed in:

Version: 6.2.5.2
Build ID: 1ec314fa52f458adc18c4f025c545a4e8b22c159
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: en-AU (en_AU.UTF-8); UI-Language: en-US
Calc: threaded

and:

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: ac0db5736a53a4887cebbacc59026cecb7c44c66
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-08-08_02:51:24
Calc: threaded