Bug 90684 - Hide decimal separator if number has no decimal part and no trailing zeroes are to be shown
Summary: Hide decimal separator if number has no decimal part and no trailing zeroes a...
Status: CLOSED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Number-Format
  Show dependency treegraph
 
Reported: 2015-04-17 19:22 UTC by Severo Raz
Modified: 2017-11-05 20:33 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
The file with the problem and workaround. (13.62 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-10-01 10:02 UTC, ask4support
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Severo Raz 2015-04-17 19:22:15 UTC
The use case of this is for when you want to format a set of cells in a column (most frequently but not limited to) with a format such as "# ##0,??". 

This becomes very comfortable for reading the numbers in the column because a) you only get the amount of decimals you want, b) you can easily compare the values visually because each digit type (namely hundredths, tenths, units, tens, hundreds, etc.) is vertically aligned with the others (at least when you align right all the cells), and c) integers can be displayed without trailing zeroes and still be aligned.

However, when a number only has an integer part, the decimal separator is still displayed after it. This looks strange since without decimals the decimal separator loses purpose: it separates no decimals.
Comment 1 Robinson Tryon (qubit) 2015-04-17 19:32:24 UTC
(In reply to Severo Raz from comment #0)
> The use case of this is for when you want to format a set of cells in a
> column (most frequently but not limited to) with a format such as "#
> ##0,??". 
> ... 
> However, when a number only has an integer part, the decimal separator is
> still displayed after it. This looks strange since without decimals the
> decimal separator loses purpose: it separates no decimals.

Why not just add-in the zeros?

So this:

1543.34
2345
5668.1

Becomes this:

1543.34
2345.00
5668.10

In some cases, sig figs are relevant to the final outcome, but I think the best practice there would be to use scientific notation.

Status -> NEEDINFO

[cc: jay]
Comment 2 Yousuf Philips (jay) (retired) 2015-04-19 12:46:15 UTC
This seems to me more of a number format issue and whether LO supports such a format. If LO supports the format and its not shown correctly, then that is a bug that should be fixed.
Comment 3 Severo Raz 2015-08-12 18:31:55 UTC
(In reply to Yousuf (Jay) Philips from comment #2)
> This seems to me more of a number format issue and whether LO supports such
> a format. If LO supports the format and its not shown correctly, then that
> is a bug that should be fixed.

Indeed Yousuf, thank you for your input

(In reply to Robinson Tryon (qubit) from comment #1)
> Why not just add-in the zeros?
> 
> So this:
> 
> 1543.34
> 2345
> 5668.1
> 
> Becomes this:
> 
> 1543.34
> 2345.00
> 5668.10
> 
> In some cases, sig figs are relevant to the final outcome, but I think the
> best practice there would be to use scientific notation.

Well having the zeroes not show is the whole purpose of this bug report, isn't it?
Comment 4 Yousuf Philips (jay) (retired) 2015-08-14 15:48:07 UTC
I tried the same formula in gnumeric and wps spreadsheets and the result was the same as in libreoffice. I believe that if you dont want the decimal point to appear because the number is an integer, there might be some thing that you can add to the formula that would give you that result.

Did some searching online and found someone asking the same thing for excel.
http://answers.microsoft.com/en-us/office/forum/office_2007-excel/removing-decimal-places-on-whole-currency-numbers/90fcc899-4a70-454b-ac58-7e013edca950?auth=1
Comment 5 Eike Rathke 2015-08-14 16:37:30 UTC
Excel does it the same, the decimal separator is always displayed. Quite likely we won't do it differently..
Comment 6 Severo Raz 2015-08-14 20:28:10 UTC
Well it's an unfortunate thing that no other spreadsheet processor can get this particular deed done right. 

However, consider this: in Calc, when the format # ##0,## format is used, the comma is not displayed; it seems awfully inconsistent that when the format # ##0,?? is used the comma does show. This looks like a bug to me, and perhaps even a lovebug.

I will reopen this, because not fixing an issue *based* solely on whether the issue is present on other office suites I regard as pure mediocrity, and perhaps you should as well. 

The fact that LibreOffice is a free office suite, and for now most probably considered an alternative office suite, is absolutely no reason to condemn it to live in MS Office's shadow.
Comment 7 Yousuf Philips (jay) (retired) 2015-08-16 17:16:18 UTC
(In reply to Severo Raz from comment #6)
> However, consider this: in Calc, when the format # ##0,## format is used,
> the comma is not displayed; it seems awfully inconsistent that when the
> format # ##0,?? is used the comma does show. This looks like a bug to me,
> and perhaps even a lovebug.

Yes it seems strange that the comma is being retained when comparing it, but i'm not a number format expert. :D

So #,##0.## shows

[      1,234]
[    1,234.1]
[   1,234.12]

And #,##0.?? shows

[   1,234.  ]
[   1,234.1 ]
[   1,234.12]

And you think it should show

[   1,234   ]
[   1,234.1 ]
[   1,234.12]

@Stuart, @Heiko, @Cor: Can you give your input on this?

> I will reopen this, because not fixing an issue *based* solely on whether
> the issue is present on other office suites I regard as pure mediocrity, and
> perhaps you should as well. 

Yes it shouldnt be solely based on whether its the same in other office suites, but compatibility with other office suites is important.
Comment 8 ask4support 2017-10-01 10:02:46 UTC Comment hidden (off-topic)
Comment 9 Heiko Tietze 2017-10-05 07:59:39 UTC Comment hidden (off-topic)
Comment 10 Eike Rathke 2017-11-01 14:14:19 UTC
The case the original report actually was about.
#,##0.??
creates a format that reserves a blank space for trailing zero digits after the decimal separator. With integer values the decimal separator is still displayed, but shouldn't.
1.23 => "1.23"
1.2  => "1.2 "
1    => "1.  " should be "1   "

Comment 8 seems to talk about some earlier version where that might had happened with .## as well, it doesn't now (and also not in 5.3 fwiw).
Comment 11 Eike Rathke 2017-11-01 14:15:41 UTC
@Laurent: maybe something for you?
Comment 12 Eike Rathke 2017-11-02 21:39:57 UTC
Note that for comment 5 I tested in Excel and it does not omit the decimal separator. I can't make up my mind whether we should or not. There is some logic in it that the separator is always displayed with .?? (blanks instead of 0, preserving columns with a fixed-width font) but not with .## (digit and place omitted if 0), and my guess is that once we changed this to not display the separator we'd get a bug report of some angry Excel document user that we did so.. YMMV..
Comment 13 Eike Rathke 2017-11-03 10:11:27 UTC
So.. made up my mind over night ;) and came to a conclusion. As all major implementations display the separator we should not change behaviour. Closing.
Comment 14 Laurent Balland 2017-11-05 20:33:27 UTC
(In reply to Eike Rathke from comment #11)
> @Laurent: maybe something for you?

Hi Eike,

I think that format ##.?? should always display decimal separator, even with integer, otherwise you will loose decimal separator alignment.