Bug 86576 - Division of two =SUM() functions holding currency formatted data is incorrectly assigned currency cell formatting
Summary: Division of two =SUM() functions holding currency formatted data is incorrect...
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86 (IA32) All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Function-Sum
  Show dependency treegraph
 
Reported: 2014-11-22 13:40 UTC by tagezi
Modified: 2020-07-29 18:08 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
simple example (9.49 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-11-22 13:40 UTC, tagezi
Details
example in $US (21.40 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-11-23 17:42 UTC, V Stuart Foote
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tagezi 2014-11-22 13:40:25 UTC
Created attachment 109849 [details]
simple example

OS:
Kubuntu 14.04.1 x86
OpenSUSE 13.1 x86

Problem description: A currency format is wrongly extended when dividing sums of currency values.

Steps to reproduce:
1. Open Calc
2. Fill in several cells with numbers. For extmple, 4 cells.
4. Select them, right-click and click format cells and give them currency format
3. Set cursor in the other cell and type =SUM(two cells)/SUM(other two cells)

Current behavior: After putting mentioned formula in any cell, it chooses the  currency format automatically.

Expected behavior: When we divide some money by the other, we obtain the ratio. Therefore, the format should not be extended. For example, simply dividing one cell by another will not extend the format.

I found this behavior in 4.2.7, maybe it was before.
Comment 1 A (Andy) 2014-11-22 22:04:28 UTC
I understand it and can reproduce it with LO 4.4.0.0.beta1 (Win 8.1), but I am not sure how this could be resolved, because for this maybe some kind of extensive elaboration or even artificial intelligence is necessary.  LO needs then to check what is calculated with which cells and formats (e.g. a multiplication with another currency cell should stay as currency, summation should stay as currency etc.).  But I don't know how this programmed, maybe there is also a simple solution and it is not that difficult.

@Markus: Can you maybe help?  Could this be resolved?
Comment 2 tagezi 2014-11-22 22:33:55 UTC
This mistake is not serious. Furthermore, the format can be removed through right-click -> Format cells. But it is not convenient. I told about the problem in hope that someone might want to fix it. If you want, I can describe the behavior in all possible mathematical operations.
But I think, that we should not pay too much attention to this, little time is left to release 4.4.

PS: If we can confirm a bug, do we need to give the status NEW now?
Comment 3 A (Andy) 2014-11-22 22:54:00 UTC
@Lera:
Thank you very much for your fast reply.
I agree with you that this no serious issue.  And I can reproduce it, but in this case I would like to wait a little bit until Markus or any other CALC programmer/expert gives an additional feedback, whether we could mark it as a bug.
Comment 4 V Stuart Foote 2014-11-23 17:42:25 UTC
Created attachment 109908 [details]
example in $US

Setting NEW, adjusting summary.

Division of two =SUM() functions holding currency formatted data is incorrectly assigned currency cell formatting.  Which differs from the cell formatting assigned to a division of a =SUM() range by a single currency formatted cell.
 
Another simple .ods example $US attached.

Verified behavior back to 3.6 branch (don't have a 3.4 or 3.5 loaded at the moment) but as same behavior in current AOO builds we likely inherited this from OOo.
Comment 5 QA Administrators 2016-09-20 09:33:46 UTC Comment hidden (obsolete)
Comment 6 tagezi 2016-09-20 09:48:20 UTC
confirm on 

Version: 5.2.3.0.0+
ID: 4b7707bb8bcf0965d2d81f9c82672cb11829737f
OS: Linux 4.6;
local: ru-RU (ru_RU.UTF-8); Calc: group
Comment 7 QA Administrators 2018-07-26 02:41:35 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2020-07-26 03:52:16 UTC Comment hidden (obsolete)
Comment 10 Eike Rathke 2020-07-29 17:47:22 UTC
Taking.
Comment 11 Eike Rathke 2020-07-29 18:07:53 UTC
This does not happen anymore since LibreOffice 5.0 or so..