Bug 97835 - FORMATTING: Spurious decimal point in user defined numeric format
Summary: FORMATTING: Spurious decimal point in user defined numeric format
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Laurent Balland
URL:
Whiteboard: target:5.2.0 target:5.1.4 target:5.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-13 11:58 UTC by kiaora-paora
Modified: 2016-10-25 18:54 UTC (History)
3 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 kiaora-paora 2016-02-13 11:58:10 UTC
If I use the ''General'' format I have:

2
1.5
1.75
1.333

If I don't want more than 2 decimal places I can use a user defined
format such as ''#.##''.  I get:

2
1.5
1.75
1.33

Good.  Now, suppose the numbers have a unit.  Let's take metres rather
than money.  The user defined format ''General" m"'' gives:

2 m
1.5 m
1.75 m
1.333 m

OK, but I don't want more than 2 decimal places so I try ''#.##" m"'':

2. m
1.5 m
1.75 m
1.33 m

Oh, sugar plum fairies and all that !  Now the first exemplar is wrong:
it is clearly inconsistent with other formats and I can't see how the
user defined format can be read as "leave in the decimal point when it
clearly isn't necessary for understanding the value displayed."

If there is an alternative way for getting the right result, please let
me know.  Otherwise, please fix.

If you decide to fix this bug, as I sincerely hope, be careful you don't inadvertently also fix bug 90684.

That bug that describes odd behaviour of an undocumented use of ? to alter
how a number is displayed and cannot be fixed for reasons of sideways
compatibility with equally brain-dead implementations elsewhere.

This bug attempts to use quotes to include text in a format without altering
how the number is displayed as documented on the help pages.  Clearly
a different issue although the two may share a root cause.

Oh, and yes, it is present in 5.1.0 but has been present since at least 3.5.7.
Comment 1 Buovjaga 2016-02-16 12:16:01 UTC
If I try ''#.##" m"''

I get for 2:
''.2 m''

If I try #.##" m"

I get for 2:
.2 m

I guess it is wrong enough. Setting to NEW.

Win 7 Pro 64-bit, Version: 5.1.0.3 (x64)
Build ID: 5e3e00a007d9b3b6efb6797a8b8e57b51ab1f737
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
Locale: fi-FI (fi_FI)
Comment 2 Laurent Balland 2016-04-25 08:01:51 UTC
(In reply to Buovjaga from comment #1)
> If I try ''#.##" m"''
> 
> I get for 2:
> ''.2 m''
> 
> If I try #.##" m"
> 
> I get for 2:
> .2 m
> 
> I guess it is wrong enough. Setting to NEW.
> 
> Win 7 Pro 64-bit, Version: 5.1.0.3 (x64)
> Build ID: 5e3e00a007d9b3b6efb6797a8b8e57b51ab1f737
> CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
> Locale: fi-FI (fi_FI)

Careful, you have to use English (or at least a language using dot as decimal separator) as Format Number Language to apply examples of Forester. Or you have to replace dot by your decimal separator (should be comma).
Your results indicate that dot is considered as a no-meaning character. 

And remove '' in your format (Forester gave them to separate format from his text).
Comment 3 Buovjaga 2016-04-25 08:18:15 UTC
Thanks. Now I used English format.

Input is 2

''#.##" m"'' results in ''2. m''

#.##" m" results in 2. m

Win 7 Pro 64-bit, Version: 5.1.2.2 (x64)
Build ID: d3bf12ecb743fc0d20e0be0c58ca359301eb705f
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
Locale: fi-FI (fi_FI)
Comment 4 Commit Notification 2016-05-03 12:21:44 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=48435bfddf38de2b31df50e70438ef7946a0c3cb

tdf#97835 No decimal separtor for empty decimal

It will be available in 5.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 2016-05-25 15:43:07 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=700a6c6360c1c83433545d472511c48ac355a1d2&h=libreoffice-5-1

tdf#97835 No decimal separtor for empty decimal

It will be available in 5.1.4.

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 2016-05-30 22:52:56 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=93874236610dd50a46b6db229e022ae364af582a

tdf#97835 tdf#61996 tdf#95339 Add qa unit test

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.