Bug 157514 - Delete Decimal Places should consider the number of visible decimal places
Summary: Delete Decimal Places should consider the number of visible decimal places
Status: RESOLVED DUPLICATE of bug 85410
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Cells
  Show dependency treegraph
 
Reported: 2023-09-29 14:43 UTC by Rafael Lima
Modified: 2023-10-07 13:17 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Video of how MS Excel handles this command (19.78 KB, video/mp4)
2023-09-29 17:39 UTC, Rafael Lima
Details
Video of how LO Calc handles the same situation (35.54 KB, video/mp4)
2023-09-29 17:43 UTC, Rafael Lima
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Lima 2023-09-29 14:43:21 UTC
When the user selects a cell with decimal numbers and click "Delete Decimal Places", the command should consider the number of currently visible decimal places in the cell and then reduce the number of decimal places considering this value.

Steps to reproduce:
1) Open a new Calc document and enter 1/3 in cell A1
2) You'll see the value 0,333333333 (with 9 visible decimal places)
3) Select cell A1 and click "Delete Decimal Place" button in the toolbar
4) Notice that you'll get ### because actually Calc was considering as a starting point the value 0,333333333333333 (with 15 decimal places); thus reducing it to 14 decimal places will cause the number to not fit the cell

Expected result
After clicking "Delete Decimal Place", we should have gotten 0,33333333 (with 8 zeros)

This is very annoying, because often times I have to click "Delete Decimal Place" 10 times to get the number of decimal places that I want.
Comment 1 Mike Kaganski 2023-09-29 15:13:06 UTC
What would be an expected result on the default-formatted cells, having different widths, or numbers showing different number of decimals because of, say, different whole part size?

Say, a column with

1.333333333333333
12.333333333333333
123.333333333333333
...

In some cells, their automatic display would be

1.333333
12.33333
123.3333

Selecting the whole column, and pressing Delete Decimal Places, would make their formatting different, right?
Comment 2 Rafael Lima 2023-09-29 17:39:24 UTC
Created attachment 189893 [details]
Video of how MS Excel handles this command

(In reply to Mike Kaganski from comment #1)
> What would be an expected result on the default-formatted cells, having
> different widths, or numbers showing different number of decimals because
> of, say, different whole part size?

In this case, I'd suggest do what MS Excel does (see attached video). Suppose you have these 3 cells (these are the visible values):

1,333333
10,33333
100,3333

If you click "Delete Decimal Places", it will consider the one with the smallest number of visible decimal places (in this case, 4 in the third cell) and then reduce them all to 3 decimal places.

  1,333
 10,333
100,333
Comment 3 Rafael Lima 2023-09-29 17:43:49 UTC
Created attachment 189894 [details]
Video of how LO Calc handles the same situation

Here's the video of how LO handles the same situation.

Notice that the first time I click I get ### in all cells... and then I have to click multiple times to get to the point where the number of decimal places is smaller than the original cell contents.
Comment 4 Mike Kaganski 2023-09-29 17:43:56 UTC
Agree, makes sense. Also had a moment when I thought that something like that would be nice.
Comment 5 Rafael Lima 2023-10-07 13:12:36 UTC
*** Bug 157651 has been marked as a duplicate of this bug. ***
Comment 6 Rafael Lima 2023-10-07 13:17:16 UTC
Ooops... this had already been requested in bug 85410.

I'm closing this as a dupe... let's concentrate the discussion there.

*** This bug has been marked as a duplicate of bug 85410 ***